From e81de827062958d94d6e2f1e0abc10d39b29e0c4 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 2 Jul 2022 22:17:17 +0200 Subject: added Vector2D::clamp --- src/helpers/Vector2D.cpp | 8 ++++++++ src/helpers/Vector2D.hpp | 2 ++ 2 files changed, 10 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp index acaace13..a96411e6 100644 --- a/src/helpers/Vector2D.cpp +++ b/src/helpers/Vector2D.cpp @@ -1,4 +1,5 @@ #include "Vector2D.hpp" +#include Vector2D::Vector2D(double xx, double yy) { x = xx; @@ -20,4 +21,11 @@ double Vector2D::normalize() { Vector2D Vector2D::floor() { return Vector2D((int)x, (int)y); +} + +Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) { + return Vector2D( + std::clamp(this->x, min.x, max.x == 0 ? INFINITY : max.x), + std::clamp(this->y, min.y, max.y == 0 ? INFINITY : max.y) + ); } \ No newline at end of file diff --git a/src/helpers/Vector2D.hpp b/src/helpers/Vector2D.hpp index 7288a088..7ca52a68 100644 --- a/src/helpers/Vector2D.hpp +++ b/src/helpers/Vector2D.hpp @@ -35,5 +35,7 @@ class Vector2D { return a.x != x || a.y != y; } + Vector2D clamp(const Vector2D& min, const Vector2D& max = Vector2D()); + Vector2D floor(); }; \ No newline at end of file -- cgit v1.2.3 From 9655d0c13822bdaa5d86fd1153c27c184fd55253 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:42:37 +0200 Subject: added support for wlr_idle_inhibitor_v1 --- src/helpers/WLClasses.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 33278053..d9374158 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -221,3 +221,14 @@ struct STabletPad { return wlrTabletPadV2 == b.wlrTabletPadV2; } }; + +struct SIdleInhibitor { + wlr_idle_inhibitor_v1* pWlrInhibitor = nullptr; + CWindow* pWindow = nullptr; + + DYNLISTENER(Destroy); + + bool operator==(const SIdleInhibitor& b) { + return pWlrInhibitor == b.pWlrInhibitor; + } +}; -- cgit v1.2.3 From f9756d10d4d1c5ea7737cf3a237b1f966d6b7a01 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:50:11 +0200 Subject: changed C++ std to C++23, use std::string::contains --- src/helpers/MiscFunctions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index cb1d88d6..126600f3 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -137,7 +137,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) { if (source.find_first_of("+") == 0) { try { - if (source.find('.') != std::string::npos) + if (source.contains(".")) result = relative + std::stof(source.substr(1)); else result = relative + std::stoi(source.substr(1)); @@ -147,7 +147,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) { } } else if (source.find_first_of("-") == 0) { try { - if (source.find('.') != std::string::npos) + if (source.contains(".")) result = relative - std::stof(source.substr(1)); else result = relative - std::stoi(source.substr(1)); @@ -157,7 +157,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) { } } else { try { - if (source.find('.') != std::string::npos) + if (source.contains(".")) result = stof(source); else result = stoi(source); -- cgit v1.2.3 From 42d18143e507a9803a402057d29387733292fb43 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:54:45 +0200 Subject: use std::unreachable in avars --- src/helpers/AnimatedVariable.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index ceda2c57..a87fff4f 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -128,10 +128,10 @@ public: case AVARTYPE_COLOR: return m_cValue != m_cGoal; default: - return false; + std::unreachable(); } - return false; // unreachable + std::unreachable(); } void warp() { @@ -149,7 +149,7 @@ public: break; } default: - break; + std::unreachable(); } } -- cgit v1.2.3 From 6a16f11d63cead0b8526f442c18727a6f3dc76ea Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 21:57:35 +0200 Subject: add namespace to hyprctl layers --- src/helpers/WLClasses.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index d9374158..0ab4c52b 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -25,6 +25,8 @@ struct SLayerSurface { int monitorID = -1; + std::string szNamespace = ""; + CAnimatedVariable alpha; bool fadingOut = false; bool readyToDelete = false; -- cgit v1.2.3 From 1cf2f378d4a0e5e3da757d90404c2816a6765626 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 22:12:03 +0200 Subject: added ls blurring --- src/helpers/WLClasses.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 0ab4c52b..b06390b5 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -31,6 +31,8 @@ struct SLayerSurface { bool fadingOut = false; bool readyToDelete = false; + bool forceBlur = false; + // For the list lookup bool operator==(const SLayerSurface& rhs) { return layerSurface == rhs.layerSurface && monitorID == rhs.monitorID; @@ -62,6 +64,9 @@ struct SRenderData { // for custom round values int rounding = -1; // -1 means not set + + // for blurring + bool blur = false; }; struct SKeyboard { -- cgit v1.2.3 From 4b796d30c190e14aa39a9540395523cee27bd348 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 7 Jul 2022 11:52:12 +0200 Subject: Added swipe workspace gestures --- src/helpers/WLClasses.hpp | 11 +++++++++++ src/helpers/Workspace.hpp | 1 + 2 files changed, 12 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index b06390b5..b6c38416 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -239,3 +239,14 @@ struct SIdleInhibitor { return pWlrInhibitor == b.pWlrInhibitor; } }; + +struct SSwipeGesture { + CWorkspace* pWorkspaceBegin = nullptr; + + double delta = 0; + + float avgSpeed = 0; + int speedPoints = 0; + + SMonitor* pMonitor = nullptr; +}; \ No newline at end of file diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index 2d0c5941..dbf0e7c0 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -28,6 +28,7 @@ public: // for animations CAnimatedVariable m_vRenderOffset; CAnimatedVariable m_fAlpha; + bool m_bForceRendering = true; // "scratchpad" bool m_bIsSpecialWorkspace = false; -- cgit v1.2.3 From 91249675dede80d59096313797e3293257cbda86 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 09:43:55 +0200 Subject: fix corner artifacts --- src/helpers/Workspace.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/helpers') diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index dbf0e7c0..5a3a24ba 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -28,7 +28,7 @@ public: // for animations CAnimatedVariable m_vRenderOffset; CAnimatedVariable m_fAlpha; - bool m_bForceRendering = true; + bool m_bForceRendering = false; // "scratchpad" bool m_bIsSpecialWorkspace = false; -- cgit v1.2.3 From 92e17f29256af4db05ebd17b9f2d013ee3ca37ab Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:27:05 +0200 Subject: added rules to hyprctl devices and fixed rules --- src/helpers/WLClasses.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index b6c38416..06f58f0a 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -69,6 +69,14 @@ struct SRenderData { bool blur = false; }; +struct SStringRuleNames { + std::string layout = ""; + std::string model = ""; + std::string variant = ""; + std::string options = ""; + std::string rules = ""; +}; + struct SKeyboard { wlr_input_device* keyboard; @@ -80,7 +88,7 @@ struct SKeyboard { std::string name = ""; - xkb_rule_names currentRules = {0}; + SStringRuleNames currentRules; int repeatRate = 0; int repeatDelay = 0; int numlockOn = -1; -- cgit v1.2.3 From 4b334594dc0d8989d8bb09c7db76694aacc71951 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 10 Jul 2022 15:41:26 +0200 Subject: Added splashes --- src/helpers/Splashes.hpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/helpers/Splashes.hpp (limited to 'src/helpers') diff --git a/src/helpers/Splashes.hpp b/src/helpers/Splashes.hpp new file mode 100644 index 00000000..68681ca2 --- /dev/null +++ b/src/helpers/Splashes.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include +#include + +inline const std::vector SPLASHES = { + "Woo, animations!", + "It's like Hypr, but better.", + "Release 1.0 when?", + "It's not awesome, it's Hyprland!", + "\"I commit too often, people can't catch up lmao\" - Vaxry", + "This text is random.", + "\"There are reasons to not use rust.\" - Boga", + "Read the wiki.", + "\"Hello everyone this is YOUR daily dose of ‘read the wiki’\" - Vaxry", + "h", + "\"‘why no work’, bro I haven't hacked your pc to get live feeds yet\" - Vaxry", + "Compile, wait for 20 minutes, notice a new commit, compile again.", + "To rice, or not to rice, that is the question.", + "Now available on Fedora!", + // music reference / quote section + "J'remue le ciel, le jour, la nuit.", + "aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi, aezakmi!", + "Wir sind schon sehr lang zusammen...", + "I see a red door and I want it painted black.", + "Take on me, take me on...", + "You spin me right round baby right round", + "Stayin' alive, stayin' alive", + "Say no way, say no way ya, no way!", + "Ground control to Major Tom...", + "Alors on danse", + "And all that I can see, is just a yellow lemon tree.", + "Got a one-way ticket to the blues", + "Is this the real life, is this just fantasy", + "What's in your head, in your head?", + "We're all living in America, America, America.", + "I'm still standing, better than I ever did", + "Here comes the sun, bringing you love and shining on everyone", + "Two trailer park girls go round the outside", + "With the lights out, it's less dangerous", + "Here we go back, this is the moment, tonight is the night", + "Now you're just somebody that I used to know...", + "Black bird, black moon, black sky", + "Some legends are told, some turn to dust or to gold", + "Your brain gets smart, but your head gets dumb.", + "Save your mercy for someone who needs it more", + "You're gonna hear my voice when I shout it out loud", + "Ding ding pch n daa, bam-ba-ba-re-bam baram bom bom baba-bam-bam-bommm", + "Súbeme la radio que esta es mi canción", + "I'm beggin', beggin' you", + // + "Join the discord server!", + "Thanks ThatOneCalculator!", + "The AUR packages always work, except for the times they don't.", + "Funny animation compositor woo" +}; \ No newline at end of file -- cgit v1.2.3 From ad66c158ba793c424519eaee0a64fb81860f5e3c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:23:16 +0200 Subject: don't refocus on virt ptrs --- src/helpers/WLClasses.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 06f58f0a..962c27b0 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -109,6 +109,8 @@ struct SMouse { std::string name = ""; + bool virt = false; + DYNLISTENER(commitConstraint); DYNLISTENER(destroyMouse); -- cgit v1.2.3 From f461ea3105fbe7979a44d702bd9b2f7ee46a9441 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:38:10 +0200 Subject: squish oversized subsurfaces while animating --- src/helpers/WLClasses.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 962c27b0..ed10b2fc 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -67,6 +67,9 @@ struct SRenderData { // for blurring bool blur = false; + + // for windows that animate poorly + bool squishOversized = false; }; struct SStringRuleNames { -- cgit v1.2.3 From 2f3b2db83d6fda5ade686157ebd6c27b3468d15b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 12 Jul 2022 09:49:56 +0200 Subject: fixed tiled popups going behind windows --- src/helpers/WLClasses.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index ed10b2fc..ce2d7248 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -72,6 +72,12 @@ struct SRenderData { bool squishOversized = false; }; +struct SExtensionFindingData { + Vector2D origin; + Vector2D vec; + wlr_surface** found; +}; + struct SStringRuleNames { std::string layout = ""; std::string model = ""; -- cgit v1.2.3