326d44a04b1b66f5f466c812269d0cf286576d40

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Merge branch 'master' into tab-bar-dmg

Diff

  1diff --git a/CHANGELOG.md b/CHANGELOG.md
  2index 52aa26a69ae6099323df014d500062a71a15ab74..aa889e4d0ca14455c669fb2d665dbb04aebbbc76 100644
  3--- a/CHANGELOG.md
  4+++ b/CHANGELOG.md
  5@@ -1,5 +1,9 @@
  6 # Changelog
  7 
  8+# Upcoming
  9+- Fixed IPC and wlr-foreign-toplevel not getting fullscreen and maximize events.
 10+- Fixed glitches when moving nodes between monitors with hy3 dispatchers.
 11+
 12 ## hl0.40.0 and before
 13 
 14 - Added `hy3:warpcursor` dispatcher to warp cursor to current node.
 15diff --git a/README.md b/README.md
 16index 2fc3f3b46bfcb8609b928a12c427a31c345a0d1a..0f86850b6e8326c2f8a9d4057c4d05a7b8aa938a 100644
 17--- a/README.md
 18+++ b/README.md
 19@@ -136,6 +136,12 @@ To update hy3 (and all other plugins), run
 20 hyprpm update
 21 ```
 22 
 23+Sometimes the headers from hyprland are not updated, if this happens run (See [issue #109](https://github.com/outfoxxed/hy3/issues/109) for an example of where this happened)
 24+
 25+```sh 
 26+hyprpm update -f
 27+```
 28+
 29 (See [the wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/) for details.)
 30 
 31 > [!WARNING]
 32diff --git a/flake.lock b/flake.lock
 33index e7610a4ffdee80b18051155ed2bfa0079e7abf02..72bae96f02c5dccafde8ec2b29315176b25f8e1f 100644
 34--- a/flake.lock
 35+++ b/flake.lock
 36@@ -16,11 +16,11 @@
 37         ]
 38       },
 39       "locked": {
 40-        "lastModified": 1716327911,
 41-        "narHash": "sha256-PI+wygItS/TKzi4gEAROvKTUzTx9GT+PGBttS/IOA/Q=",
 42+        "lastModified": 1717181720,
 43+        "narHash": "sha256-yv+QZWsusu/NWjydkxixHC2g+tIJ9v+xkE2EiVpJj6g=",
 44         "owner": "hyprwm",
 45         "repo": "hyprcursor",
 46-        "rev": "27ca640abeef2d425b5dbecf804f5eb622cef56d",
 47+        "rev": "9e27a2c2ceb1e0b85bd55b0afefad196056fe87c",
 48         "type": "github"
 49       },
 50       "original": {
 51@@ -39,11 +39,11 @@
 52         "xdph": "xdph"
 53       },
 54       "locked": {
 55-        "lastModified": 1716491954,
 56-        "narHash": "sha256-Qf1mEPacXhhM5KFm7HG2F/UBfzkjSBK57gKquA5TAVY=",
 57+        "lastModified": 1717970802,
 58+        "narHash": "sha256-kFnaAmte/N1mrbHEQyrwDu9+laZzVAi4N2nQodCNfgg=",
 59         "ref": "refs/heads/main",
 60-        "rev": "4e42107d25dc47ee94da282db233f85f1e4c6bd0",
 61-        "revCount": 4733,
 62+        "rev": "1423707dbefc0329e80895451903a77ab684f7ea",
 63+        "revCount": 4789,
 64         "submodules": true,
 65         "type": "git",
 66         "url": "https://github.com/hyprwm/Hyprland"
 67@@ -93,11 +93,11 @@
 68         ]
 69       },
 70       "locked": {
 71-        "lastModified": 1715791527,
 72-        "narHash": "sha256-HhQ4zvGHrRjR63ltySSeg+x+0jb0lepiutWdnFhLRoo=",
 73+        "lastModified": 1716473782,
 74+        "narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=",
 75         "owner": "hyprwm",
 76         "repo": "hyprlang",
 77-        "rev": "969cb076e5b76f2e823aeca1937a3e1f159812ee",
 78+        "rev": "87d5d984109c839482b88b4795db073eb9ed446f",
 79         "type": "github"
 80       },
 81       "original": {
 82@@ -118,11 +118,11 @@
 83         ]
 84       },
 85       "locked": {
 86-        "lastModified": 1716058375,
 87-        "narHash": "sha256-CwjWoVnBZE5SBpRx9dgSQGCr4Goxyfcyv3zZbOhVqzk=",
 88+        "lastModified": 1717784906,
 89+        "narHash": "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM=",
 90         "owner": "hyprwm",
 91         "repo": "hyprwayland-scanner",
 92-        "rev": "3afed4364790aebe0426077631af1e164a9650cc",
 93+        "rev": "0f30f9eca6e404130988554accbb64d1c9ec877d",
 94         "type": "github"
 95       },
 96       "original": {
 97@@ -133,11 +133,11 @@
 98     },
 99     "nixpkgs": {
100       "locked": {
101-        "lastModified": 1716330097,
102-        "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
103+        "lastModified": 1717602782,
104+        "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=",
105         "owner": "NixOS",
106         "repo": "nixpkgs",
107-        "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
108+        "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6",
109         "type": "github"
110       },
111       "original": {
112diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
113index 12963f863ce4b2c630721cce1671f6cc6f799b2d..0bf51150dbf3460b92b1a2cc46b94263fb034f30 100644
114--- a/src/Hy3Layout.cpp
115+++ b/src/Hy3Layout.cpp
116@@ -503,6 +503,12 @@ void Hy3Layout::fullscreenRequestForWindow(
117 	window->m_bIsFullscreen = on;
118 	window->m_pWorkspace->m_bHasFullscreenWindow = !window->m_pWorkspace->m_bHasFullscreenWindow;
119 
120+	window->updateDynamicRules();
121+	window->updateWindowDecos();
122+
123+	g_pEventManager->postEvent(SHyprIPCEvent {"fullscreen", std::to_string((int) on)});
124+	EMIT_HOOK_EVENT("fullscreen", window);
125+
126 	if (!window->m_bIsFullscreen) {
127 		auto* node = this->getNodeFromWindow(window);
128 
129@@ -947,9 +953,12 @@ void changeNodeWorkspaceRecursive(Hy3Node& node, const PHLWORKSPACE& workspace)
130 
131 	if (node.data.is_window()) {
132 		auto window = node.data.as_window();
133+		g_pHyprRenderer->damageWindow(window);
134 		window->moveToWorkspace(workspace);
135+		window->m_iMonitorID = workspace->m_iMonitorID;
136 		window->updateToplevel();
137 		window->updateDynamicRules();
138+		window->uncacheWindowDecos();
139 	} else {
140 		for (auto* child: node.data.as_group().children) {
141 			changeNodeWorkspaceRecursive(*child, workspace);
142@@ -990,6 +999,7 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna
143 	if (focused_window != nullptr
144 	    && (focused_window_node == nullptr || focused_window->m_bIsFullscreen))
145 	{
146+		g_pHyprRenderer->damageWindow(focused_window);
147 		g_pCompositor->moveWindowToWorkspaceSafe(focused_window, workspace);
148 	} else {
149 		if (node == nullptr) return;
150@@ -1009,6 +1019,8 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna
151 
152 		changeNodeWorkspaceRecursive(*node, workspace);
153 		this->insertNode(*node);
154+		g_pCompositor->updateWorkspaceWindows(origin->m_iID);
155+		g_pCompositor->updateWorkspaceWindows(workspace->m_iID);
156 	}
157 
158 	if (follow) {
159diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
160index 02caeff276afee3dd9183e06d54466730464ab95..f892a83cbf523cab96f18110cb729526045f7ff4 100644
161--- a/src/TabGroup.cpp
162+++ b/src/TabGroup.cpp
163@@ -11,6 +11,8 @@
164 #include <pixman.h>
165 
166 #include "globals.hpp"
167+#include "src/helpers/memory/SharedPtr.hpp"
168+#include "src/render/Texture.hpp"
169 
170 Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) {
171 	this->focused
172@@ -52,6 +54,8 @@ Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_b
173 
174 	this->vertical_pos = 0.0;
175 	this->fade_opacity = 1.0;
176+
177+	this->texture = makeShared<CTexture>();
178 }
179 
180 bool Hy3TabBarEntry::operator==(const Hy3Node& node) const { return this->node == node; }
181@@ -117,7 +121,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) {
182 
183 	auto rounding = std::min((double) *s_rounding * scale, std::min(width * 0.5, height * 0.5));
184 
185-	if (this->texture.m_iTexID == 0
186+	if (this->texture->m_iTexID == 0
187 	    // clang-format off
188 			|| this->last_render.x != box.x
189 			|| this->last_render.y != box.y
190@@ -228,9 +232,9 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) {
191 		cairo_surface_flush(cairo_surface);
192 
193 		auto data = cairo_image_surface_get_data(cairo_surface);
194-		this->texture.allocate();
195+		this->texture->allocate();
196 
197-		glBindTexture(GL_TEXTURE_2D, this->texture.m_iTexID);
198+		glBindTexture(GL_TEXTURE_2D, this->texture->m_iTexID);
199 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
200 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
201 
202@@ -244,7 +248,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) {
203 		cairo_destroy(cairo);
204 		cairo_surface_destroy(cairo_surface);
205 	} else {
206-		glBindTexture(GL_TEXTURE_2D, this->texture.m_iTexID);
207+		glBindTexture(GL_TEXTURE_2D, this->texture->m_iTexID);
208 	}
209 }
210 
211diff --git a/src/TabGroup.hpp b/src/TabGroup.hpp
212index 149340dcd2f44a2722b8c7cf763264565334e913..70339c938d21c302e41fbf19cdb374547aa60bd7 100644
213--- a/src/TabGroup.hpp
214+++ b/src/TabGroup.hpp
215@@ -15,7 +15,7 @@ class Hy3TabBar;
216 struct Hy3TabBarEntry {
217 	std::string window_title;
218 	bool destroying = false;
219-	CTexture texture;
220+	SP<CTexture> texture;
221 	CAnimatedVariable<float> focused;
222 	CAnimatedVariable<float> urgent;
223 	CAnimatedVariable<float> offset;       // 0.0-1.0 of total bar