8daf42ecf8647ab68e169fa589b26247960b00bb

Author
Étienne Lafarge <etienne.lafarge@gmail.com>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

fixup: chase hyprland workspace refactor (#16140)

Hyprland upstream e9e2f64 ("workspace: refactor workspace handling
(#16140)") renamed CWorkspace to Workspace::CHLWorkspace (moved to
src/workspace/HLWorkspace.hpp) and reworked the workspace state APIs.

Diff

This diff is truncated to protect this page.

  1diff --git a/flake.lock b/flake.lock
  2index 4869a77af1c29a7e306eb0b6c6932f44db9ede7f..893d38c030400a5820e38a4dcf368bb537cbe3bf 100644
  3--- a/flake.lock
  4+++ b/flake.lock
  5@@ -20,11 +20,11 @@
  6         ]
  7       },
  8       "locked": {
  9-        "lastModified": 1784368054,
 10-        "narHash": "sha256-zF1iJkBQSDWmRO4/LEeHR1SpKY0lqZaxkoQJpPS9K9U=",
 11+        "lastModified": 1788444081,
 12+        "narHash": "sha256-I8i97p9WBQaZQyyBaHFMt8e01VfgfFZSaO+vAUd0u0A=",
 13         "owner": "hyprwm",
 14         "repo": "aquamarine",
 15-        "rev": "9b5f14d9483445e766294eb8fbe0b8f370269ed0",
 16+        "rev": "36b66db4ddd708ad19f5db850af6a478d8a19b2a",
 17         "type": "github"
 18       },
 19       "original": {
 20@@ -65,11 +65,11 @@
 21         ]
 22       },
 23       "locked": {
 24-        "lastModified": 1776511930,
 25-        "narHash": "sha256-fCpwFiTW0rT7oKJqr3cqHMnkwypSwQKpbtUEtxdkgrM=",
 26+        "lastModified": 1786464181,
 27+        "narHash": "sha256-2alOMkLjXANh7unkZnYnCF2K2rApZaOLMoQ3o+VX2CY=",
 28         "owner": "hyprwm",
 29         "repo": "hyprcursor",
 30-        "rev": "39435900785d0c560c6ae8777d29f28617d031ef",
 31+        "rev": "e4ed7c08123df5af460a0a70961380cbfb872f76",
 32         "type": "github"
 33       },
 34       "original": {
 35@@ -94,11 +94,11 @@
 36         ]
 37       },
 38       "locked": {
 39-        "lastModified": 1782566056,
 40-        "narHash": "sha256-haEZcHzYrePnjFOYSWTbxm/Nrla0aPslJfmvdCvqtVc=",
 41+        "lastModified": 1786464367,
 42+        "narHash": "sha256-k58p4wbzIXWyRWrW84pP8tD+iaZSSYiiM+fr0Auk4oU=",
 43         "owner": "hyprwm",
 44         "repo": "hyprgraphics",
 45-        "rev": "c6e7b9f673f4360bc813d3dc75028f75ee88d3f8",
 46+        "rev": "7c895c44e3ca6d28ed68ddd80ec02b02b925e7fc",
 47         "type": "github"
 48       },
 49       "original": {
 50@@ -124,17 +124,17 @@
 51         "xdph": "xdph"
 52       },
 53       "locked": {
 54-        "lastModified": 1784533848,
 55-        "narHash": "sha256-1dt2IyLBRn9ji79xxv82/Gh7semHCk8cjajtg72sWGI=",
 56+        "lastModified": 1788962582,
 57+        "narHash": "sha256-o4ZJYn3xlt2YUayObZfC5cV9ZtlcCfJjfvk648nub6Q=",
 58         "owner": "hyprwm",
 59         "repo": "hyprland",
 60-        "rev": "36b2e0cfe0c6094dbc47bd42a437431315bb3087",
 61+        "rev": "e9e2f64ccfd53c5e0729f8266608c937bffebf7c",
 62         "type": "github"
 63       },
 64       "original": {
 65         "owner": "hyprwm",
 66         "repo": "hyprland",
 67-        "rev": "36b2e0cfe0c6094dbc47bd42a437431315bb3087",
 68+        "rev": "e9e2f64ccfd53c5e0729f8266608c937bffebf7c",
 69         "type": "github"
 70       }
 71     },
 72@@ -171,11 +171,11 @@
 73         ]
 74       },
 75       "locked": {
 76-        "lastModified": 1784196523,
 77-        "narHash": "sha256-ahtKMGXFJdlQNhatQm1+BBU/pGfGYnAqQt3vWvq4p8s=",
 78+        "lastModified": 1786464504,
 79+        "narHash": "sha256-7sHwM86KILQyHDHDuE2SDBlQ2jvZ0EW3hY7sW009/cg=",
 80         "owner": "hyprwm",
 81         "repo": "hyprland-guiutils",
 82-        "rev": "a6ccb6cb112ed5a244c0191fb972347ecfa893e0",
 83+        "rev": "4c30cf3097ea963c0e250749ee0c59f8b08816d6",
 84         "type": "github"
 85       },
 86       "original": {
 87@@ -225,11 +225,11 @@
 88         ]
 89       },
 90       "locked": {
 91-        "lastModified": 1777320127,
 92-        "narHash": "sha256-Qu+Wf2Bp5qUjyn2YpZNq8a7JyzTGowhT1knrwE38a9U=",
 93+        "lastModified": 1786464129,
 94+        "narHash": "sha256-339AkTlpMYSIvFuG0rnR+8Yg4/AZKeJalshJavlnKfg=",
 95         "owner": "hyprwm",
 96         "repo": "hyprlang",
 97-        "rev": "090117506ddc3d7f26e650ff344d378c2ec329cc",
 98+        "rev": "9508458be316a0d70d37ebed1ab725ccd10411ff",
 99         "type": "github"
100       },
101       "original": {
102@@ -277,11 +277,11 @@
103         ]
104       },
105diff --git a/flake.nix b/flake.nix
106index d59f7f339c38199a205c14e3637b05c533e00e23..17ee421f44ba395053114f46dcb3b472ee2b924c 100644
107--- a/flake.nix
108+++ b/flake.nix
109@@ -1,6 +1,6 @@
110 {
111   inputs = {
112-    hyprland.url = "github:hyprwm/hyprland/36b2e0cfe0c6094dbc47bd42a437431315bb3087";
113+    hyprland.url = "github:hyprwm/hyprland/e9e2f64ccfd53c5e0729f8266608c937bffebf7c";
114   };
115 
116   outputs = {
117diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
118index f2f47a19475aaecaf9aea8396cd145a20fd0655f..c4df9acbc784f3c549a87a554b4d4d4c2ff3906a 100644
119--- a/src/Hy3Layout.cpp
120+++ b/src/Hy3Layout.cpp
121@@ -12,7 +12,7 @@
122 #include <hyprland/src/desktop/state/FocusState.hpp>
123 #include <hyprland/src/config/ConfigManager.hpp>
124 #include <hyprland/src/desktop/DesktopTypes.hpp>
125-#include <hyprland/src/desktop/Workspace.hpp>
126+#include <hyprland/src/workspace/HLWorkspace.hpp>
127 #include <hyprland/src/desktop/view/window/WindowPresentation.hpp>
128 #include <hyprland/src/desktop/rule/Engine.hpp>
129 #include <hyprland/src/managers/SeatManager.hpp>
130@@ -174,7 +174,7 @@ void Hy3Layout::newTarget(SP<Layout::ITarget> target) {
131 	    "newTarget called with window {:x} (monitor: {}, workspace: {})",
132 	    (uintptr_t) window.get(),
133 	    window->monitorID(),
134-	    target->workspace() ? target->workspace()->m_id : -1
135+	    target->workspace() ? target->workspace()->addressableName() : "null"
136 	);
137 
138 	auto* existing = this->getNodeFromTarget(target);
139@@ -208,9 +208,9 @@ void Hy3Layout::insertNode(UP<Hy3Node> node_up, std::optional<Vector2D> focalPoi
140 	if (!valid(ws)) {
141 		hy3_log(
142 		    ERR,
143-		    "insertNode called for node {:x} with invalid workspace id {}",
144+		    "insertNode called for node {:x} with invalid workspace {}",
145 		    (uintptr_t) node_up.get(),
146-		    ws ? ws->m_id : -1
147+		    ws ? ws->addressableName() : "null"
148 		);
149 		return;
150 	}
151@@ -433,7 +433,7 @@ void Hy3Layout::recalcGeometry(bool no_animation) {
152 	auto workspace = space->workspace();
153 	if (!workspace) return;
154 
155-	hy3_log(LOG, "recalculating workspace {}", workspace->m_id);
156+	hy3_log(LOG, "recalculating workspace {}", workspace->addressableName());
157 
158 	auto ma = workspace->m_monitor->logicalBoxMinusReserved();
159 	auto wa = space->workArea();
160@@ -610,7 +610,7 @@ PHLWINDOW Hy3Layout::findFloatingWindowCandidate(const CWindow* from) {
161 }
162 
163 void Hy3Layout::makeGroupOnWorkspace(
164-    const CWorkspace* workspace,
165+    const Workspace::CHLWorkspace* workspace,
166     Hy3GroupLayout layout,
167     GroupEphemeralityOption ephemeral,
168     bool toggle
169@@ -639,7 +639,7 @@ void Hy3Layout::makeGroupOnWorkspace(
170 }
171 
172 void Hy3Layout::makeOppositeGroupOnWorkspace(
173-    const CWorkspace* workspace,
174+    const Workspace::CHLWorkspace* workspace,
175     GroupEphemeralityOption ephemeral
176 ) {
177 	auto* node = this->getWorkspaceFocusedNode(workspace);
178@@ -648,7 +648,7 @@ void Hy3Layout::makeOppositeGroupOnWorkspace(
179 	this->makeOppositeGroupOn(*node, ephemeral);
180 }
181 
182-void Hy3Layout::changeGroupOnWorkspace(const CWorkspace* workspace, Hy3GroupLayout layout) {
183+void Hy3Layout::changeGroupOnWorkspace(const Workspace::CHLWorkspace* workspace, Hy3GroupLayout layout) {
184 	auto* node = this->getWorkspaceFocusedNode(workspace);
185 	if (node == nullptr) return;
186 	node = &node->getPlacementActor();
187@@ -656,7 +656,7 @@ void Hy3Layout::changeGroupOnWorkspace(const CWorkspace* workspace, Hy3GroupLayo
188 	this->changeGroupOn(*node, layout);
189 }
190 
191-void Hy3Layout::untabGroupOnWorkspace(const CWorkspace* workspace) {
192+void Hy3Layout::untabGroupOnWorkspace(const Workspace::CHLWorkspace* workspace) {
193 	auto* node = this->getWorkspaceFocusedNode(workspace);
194 	if (node == nullptr) return;
195 	node = &node->getPlacementActor();
196@@ -664,7 +664,7 @@ void Hy3Layout::untabGroupOnWorkspace(const CWorkspace* workspace) {
197 	this->untabGroupOn(*node);
198 }
199 
200-void Hy3Layout::toggleTabGroupOnWorkspace(const CWorkspace* workspace) {
201+void Hy3Layout::toggleTabGroupOnWorkspace(const Workspace::CHLWorkspace* workspace) {
202 	auto* node = this->getWorkspaceFocusedNode(workspace);
203 	if (node == nullptr) return;
204 	node = &node->getPlacementActor();
205@@ -672,7 +672,7 @@ void Hy3Layout::toggleTabGroupOnWorkspace(const CWorkspace* workspace) {
206 	this->toggleTabGroupOn(*node);
207 }
208 
209-void Hy3Layout::changeGroupToOppositeOnWorkspace(const CWorkspace* workspace) {
210+void Hy3Layout::changeGroupToOppositeOnWorkspace(const Workspace::CHLWorkspace* workspace) {
211 	auto* node = this->getWorkspaceFocusedNode(workspace);
212 	if (node == nullptr) return;
213 	node = &node->getPlacementActor();
214@@ -680,7 +680,7 @@ void Hy3Layout::changeGroupToOppositeOnWorkspace(const CWorkspace* workspace) {
215 	this->changeGroupToOppositeOn(*node);
216 }
217 
218-void Hy3Layout::changeGroupEphemeralityOnWorkspace(const CWorkspace* workspace, bool ephemeral) {
219+void Hy3Layout::changeGroupEphemeralityOnWorkspace(const Workspace::CHLWorkspace* workspace, bool ephemeral) {
220 	auto* node = this->getWorkspaceFocusedNode(workspace);
221diff --git a/src/Hy3Layout.hpp b/src/Hy3Layout.hpp
222index ae7fa993f76fd7697ac17d8e140e002a6565efc4..a25a5ae4bf0893d0531847d6d0a5dd630c14abf6 100644
223--- a/src/Hy3Layout.hpp
224+++ b/src/Hy3Layout.hpp
225@@ -122,17 +122,17 @@ public:
226 	void updateGroupBorderColors();
227 
228 	void makeGroupOnWorkspace(
229-	    const CWorkspace* workspace,
230+	    const Workspace::CHLWorkspace* workspace,
231 	    Hy3GroupLayout,
232 	    GroupEphemeralityOption,
233 	    bool toggle
234 	);
235-	void makeOppositeGroupOnWorkspace(const CWorkspace* workspace, GroupEphemeralityOption);
236-	void changeGroupOnWorkspace(const CWorkspace* workspace, Hy3GroupLayout);
237-	void untabGroupOnWorkspace(const CWorkspace* workspace);
238-	void toggleTabGroupOnWorkspace(const CWorkspace* workspace);
239-	void changeGroupToOppositeOnWorkspace(const CWorkspace* workspace);
240-	void changeGroupEphemeralityOnWorkspace(const CWorkspace* workspace, bool ephemeral);
241+	void makeOppositeGroupOnWorkspace(const Workspace::CHLWorkspace* workspace, GroupEphemeralityOption);
242+	void changeGroupOnWorkspace(const Workspace::CHLWorkspace* workspace, Hy3GroupLayout);
243+	void untabGroupOnWorkspace(const Workspace::CHLWorkspace* workspace);
244+	void toggleTabGroupOnWorkspace(const Workspace::CHLWorkspace* workspace);
245+	void changeGroupToOppositeOnWorkspace(const Workspace::CHLWorkspace* workspace);
246+	void changeGroupEphemeralityOnWorkspace(const Workspace::CHLWorkspace* workspace, bool ephemeral);
247 	void makeGroupOn(Hy3Node&, Hy3GroupLayout, GroupEphemeralityOption);
248 	void makeOppositeGroupOn(Hy3Node&, GroupEphemeralityOption);
249 	void changeGroupOn(Hy3Node&, Hy3GroupLayout);
250@@ -141,27 +141,27 @@ public:
251 	void changeGroupToOppositeOn(Hy3Node&);
252 	void changeGroupEphemeralityOn(Hy3Node&, bool ephemeral);
253 	void shiftNode(Hy3Node&, ShiftDirection, bool once, bool visible);
254-	void shiftWindow(const CWorkspace* workspace, ShiftDirection, bool once, bool visible);
255-	void shiftFocus(const CWorkspace* workspace, ShiftDirection, bool visible, bool warp);
256-	void toggleFocusLayer(const CWorkspace* workspace, bool warp);
257+	void shiftWindow(const Workspace::CHLWorkspace* workspace, ShiftDirection, bool once, bool visible);
258+	void shiftFocus(const Workspace::CHLWorkspace* workspace, ShiftDirection, bool visible, bool warp);
259+	void toggleFocusLayer(const Workspace::CHLWorkspace* workspace, bool warp);
260 	bool shiftMonitor(Hy3Node&, ShiftDirection, bool follow);
261 	Hy3Node* focusMonitor(ShiftDirection);
262 
263 	void warpCursor();
264-	void moveNodeToWorkspace(CWorkspace* origin, std::string wsname, bool follow, bool warp);
265-	void changeFocus(const CWorkspace* workspace, FocusShift);
266+	void moveNodeToWorkspace(Workspace::CHLWorkspace* origin, std::string wsname, bool follow, bool warp);
267+	void changeFocus(const Workspace::CHLWorkspace* workspace, FocusShift);
268 	void focusTab(
269-	    const CWorkspace* workspace,
270+	    const Workspace::CHLWorkspace* workspace,
271 	    TabFocus target,
272 	    TabFocusMousePriority,
273 	    bool wrap_scroll,
274 	    int index
275 	);
276-	void setNodeSwallow(const CWorkspace* workspace, SetSwallowOption);
277-	void killFocusedNode(const CWorkspace* workspace);
278-	void expand(const CWorkspace* workspace, ExpandOption, ExpandFullscreenOption);
279-	void setTabLock(const CWorkspace* workspace, TabLockMode);
280-	void equalize(const CWorkspace* workspace, bool recursive = false);
281+	void setNodeSwallow(const Workspace::CHLWorkspace* workspace, SetSwallowOption);
282+	void killFocusedNode(const Workspace::CHLWorkspace* workspace);
283+	void expand(const Workspace::CHLWorkspace* workspace, ExpandOption, ExpandFullscreenOption);
284+	void setTabLock(const Workspace::CHLWorkspace* workspace, TabLockMode);
285+	void equalize(const Workspace::CHLWorkspace* workspace, bool recursive = false);
286 	static void warpCursorToBox(const Vector2D& pos, const Vector2D& size);
287 	static void warpCursorWithFocus(const Vector2D& pos, bool force = false);
288 	static std::string debugNodes();
289@@ -170,9 +170,9 @@ public:
290 	PHLWINDOW findTiledWindowCandidate(const Desktop::View::CWindow* from);
291 	PHLWINDOW findFloatingWindowCandidate(const Desktop::View::CWindow* from);
292 
293-	Hy3Node* getWorkspaceRootGroup(const CWorkspace* workspace);
294+	Hy3Node* getWorkspaceRootGroup(const Workspace::CHLWorkspace* workspace);
295 	Hy3Node* getWorkspaceFocusedNode(
296-	    const CWorkspace* workspace,
297+	    const Workspace::CHLWorkspace* workspace,
298 	    bool ignore_group_focus = false,
299 	    bool stop_at_expanded = false
300 	);
301@@ -192,7 +192,7 @@ private:
302 	Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool shift, bool once, bool visible);
303 
304 	void updateAutotileWorkspaces();
305-	bool shouldAutotileWorkspace(const CWorkspace* workspace);
306+	bool shouldAutotileWorkspace(const Workspace::CHLWorkspace* workspace);
307 
308 	// Per-instance event listeners
309 	CHyprSignalListener m_windowActiveListener;
310diff --git a/src/Hy3Node.cpp b/src/Hy3Node.cpp
311index c55ff1f3e33a1fc83592bce0bcdf281b00e6a0e7..f86c7678fbd4d84f6581692f52ab29b40a4a184d 100644
312--- a/src/Hy3Node.cpp
313+++ b/src/Hy3Node.cpp
314@@ -655,7 +655,7 @@ std::string Hy3Node::debugNode() {
315 		case Hy3GroupLayout::Root: {
316 			auto* l = this->layout();
317 			auto ws = l ? l->workspace() : nullptr;
318-			buf << "root " << (ws ? ws->m_id : -1);
319+			buf << "root " << (ws ? ws->addressableName() : "null");
320 			break;
321 		}
322 		case Hy3GroupLayout::SplitH: buf << "splith"; break;
323diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
324index 7f9fbd189b0d079b81e1524347009b48c318facc..447222bee39f1252ad62974eeb1fcea8c4d50e0e 100644
325--- a/src/TabGroup.cpp
326+++ b/src/TabGroup.cpp
327@@ -10,7 +10,7 @@
328 #include <hyprland/src/desktop/state/FocusState.hpp>
329 #include <hyprland/src/config/ConfigManager.hpp>
330 #include <hyprland/src/desktop/DesktopTypes.hpp>
331-#include <hyprland/src/desktop/Workspace.hpp>
332+#include <hyprland/src/workspace/HLWorkspace.hpp>
333 #include <hyprland/src/desktop/view/window/WindowPresentation.hpp>
334 #include <hyprland/src/desktop/view/types/Geometric.hpp>
335 #include <hyprland/src/helpers/Color.hpp>
336diff --git a/src/globals.hpp b/src/globals.hpp
337index 6acbe1c14fa388045e9a51e6c98c37c080627474..90baaa8e1d5d752f22d70ec4038834d92a03bd20 100644
338--- a/src/globals.hpp
339+++ b/src/globals.hpp
340@@ -3,7 +3,7 @@
341 #include <set>
342 #include <vector>
343 
344-#include <hyprland/src/desktop/Workspace.hpp>
345+#include <hyprland/src/workspace/HLWorkspace.hpp>
346 #include <hyprland/src/config/ConfigValue.hpp>
347 #include <hyprland/src/plugins/PluginAPI.hpp>
348 #include <hyprlang.hpp>
349@@ -29,8 +29,8 @@ inline CHyprSignalListener g_windowTitleListener;
350 inline CHyprSignalListener g_urgentListener;
351 
352 inline Hy3Layout* hy3InstanceForWorkspace(PHLWORKSPACE ws) {
353-	if (!ws || !ws->m_space || !ws->m_space->algorithm()) return nullptr;
354-	return dynamic_cast<Hy3Layout*>(ws->m_space->algorithm()->tiledAlgo().get());
355+	if (!ws || !ws->space() || !ws->space()->algorithm()) return nullptr;
356+	return dynamic_cast<Hy3Layout*>(ws->space()->algorithm()->tiledAlgo().get());
357 }
358 
359 inline void errorNotif() {