ded5e168f3a8d1290b34d696930098e8c141404d
- Author
- outfoxxed <outfoxxed@outfoxxed.me>
- Committer
- outfoxxed <outfoxxed@outfoxxed.me>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/flake.lock b/flake.lock
2index 09c670f232f96aa0c9879835e049e79366d130f3..3bde2180e07337be30acda305ba9e17d8678a12e 100644
3--- a/flake.lock
4+++ b/flake.lock
5@@ -20,11 +20,11 @@
6 ]
7 },
8 "locked": {
9- "lastModified": 1777499565,
10- "narHash": "sha256-nU55VWk99Pn1QzQDDjFISocC4SgDZ3Xp+zb6ji3JclM=",
11+ "lastModified": 1780756231,
12+ "narHash": "sha256-tXQxKdG5716uB9/LIkLQqQwHKf5mRSpHoZhz3lyI2Cg=",
13 "owner": "hyprwm",
14 "repo": "aquamarine",
15- "rev": "813c1e8981893c11e118b19c125d6bc282f51765",
16+ "rev": "6ecde03f47172753fe5a2f334f9d3facfb7e6784",
17 "type": "github"
18 },
19 "original": {
20@@ -146,17 +146,17 @@
21 "xdph": "xdph"
22 },
23 "locked": {
24- "lastModified": 1778333727,
25- "narHash": "sha256-RGYGbW6aH3jUwGVB9BrSYcKsQj7Dl2K32ao5aWbTK40=",
26+ "lastModified": 1781729184,
27+ "narHash": "sha256-S5Lq1/5RgsLZSFMrjnO5jzpV3/3q3Zt4Nsrz2TnVQzQ=",
28 "owner": "hyprwm",
29 "repo": "hyprland",
30- "rev": "af923e30d1d24f1f4a4f5cb8308065173c1d9539",
31+ "rev": "2b81ad3bdf95d866b2c51460e67474f3190e6a80",
32 "type": "github"
33 },
34 "original": {
35 "owner": "hyprwm",
36 "repo": "hyprland",
37- "rev": "af923e30d1d24f1f4a4f5cb8308065173c1d9539",
38+ "rev": "2b81ad3bdf95d866b2c51460e67474f3190e6a80",
39 "type": "github"
40 }
41 },
42@@ -324,11 +324,11 @@
43 ]
44 },
45 "locked": {
46- "lastModified": 1778234770,
47- "narHash": "sha256-jAcsogZwWMfXT9MfXxZzkwliAqIuZUV0p71h6Ba9ReE=",
48+ "lastModified": 1780251518,
49+ "narHash": "sha256-fG9xbb1SOAAJ+2kJRakp3ch+BmA/3dEg/K3PoAZTKkw=",
50 "owner": "hyprwm",
51 "repo": "hyprutils",
52- "rev": "a2dbd8a4cc51f7cbe4224732668392bb1aa79df2",
53+ "rev": "40ede2e7bdec80ba5d4c443160d905e9f841ae5f",
54 "type": "github"
55 },
56 "original": {
57@@ -378,11 +378,11 @@
58 ]
59 },
60 "locked": {
61- "lastModified": 1777388329,
62- "narHash": "sha256-40YxVGF2rA9iH3D7am5fy4EOSBbMgpJtJ9yhl0Cx+qI=",
63+ "lastModified": 1778410714,
64+ "narHash": "sha256-o6RzFj4nJXaPRY7EM01siuCQeT41RfwwmcmFQqwFJJg=",
65 "owner": "hyprwm",
66 "repo": "hyprwire",
67- "rev": "04be2897e05f9b271d532b5ae56ca088d2eeac02",
68+ "rev": "85148a8e612808cf5ddb25d0b3c5840f3498a7dc",
69 "type": "github"
70 },
71 "original": {
72@@ -393,11 +393,11 @@
73 },
74 "nixpkgs": {
75 "locked": {
76- "lastModified": 1777954456,
77- "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
78+ "lastModified": 1780749050,
79+ "narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=",
80 "owner": "NixOS",
81 "repo": "nixpkgs",
82- "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
83+ "rev": "a799d3e3886da994fa307f817a6bc705ae538eeb",
84 "type": "github"
85 },
86 "original": {
87@@ -417,11 +417,11 @@
88 ]
89 },
90 "locked": {
91- "lastModified": 1776796298,
92- "narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=",
93+ "lastModified": 1778507602,
94+ "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
95 "owner": "cachix",
96 "repo": "git-hooks.nix",
97- "rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad",
98+ "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
99 "type": "github"
100 },
101 "original": {
102@@ -478,11 +478,11 @@
103 ]
104 },
105diff --git a/flake.nix b/flake.nix
106index 5d0104d5a53a11930f169ca5b3c99d8ef8101dfb..d30def5ed97fae54e39913d50f047690fefb149e 100644
107--- a/flake.nix
108+++ b/flake.nix
109@@ -1,6 +1,6 @@
110 {
111 inputs = {
112- hyprland.url = "github:hyprwm/hyprland/af923e30d1d24f1f4a4f5cb8308065173c1d9539";
113+ hyprland.url = "github:hyprwm/hyprland/2b81ad3bdf95d866b2c51460e67474f3190e6a80";
114 };
115
116 outputs = {
117diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
118index 9dbbadc968f8f2afc6b520fdb28003b40fe14065..c0f68af0368a8583a72234271114e300ee7e4835 100644
119--- a/src/Hy3Layout.cpp
120+++ b/src/Hy3Layout.cpp
121@@ -5,6 +5,9 @@
122
123 #include <dlfcn.h>
124 #include <hyprland/src/Compositor.hpp>
125+#include <hyprland/src/output/Monitor.hpp>
126+#include <hyprland/src/state/WorkspaceState.hpp>
127+#include <hyprland/src/state/MonitorState.hpp>
128 #include <hyprland/src/desktop/state/FocusState.hpp>
129 #include <hyprland/src/config/ConfigManager.hpp>
130 #include <hyprland/src/desktop/DesktopTypes.hpp>
131@@ -149,10 +152,10 @@ PHLWORKSPACE Hy3Layout::workspace() {
132 return space->workspace();
133 }
134
135-CMonitor* Hy3Layout::monitor() {
136+PHLMONITORREF Hy3Layout::monitor() {
137 auto ws = workspace();
138 if (!ws) return nullptr;
139- return ws->m_monitor.get();
140+ return ws->m_monitor;
141 }
142
143 // ITiledAlgorithm overrides
144@@ -826,7 +829,11 @@ void Hy3Layout::shiftFocus(
145 }
146
147 Hy3Node* Hy3Layout::focusMonitor(ShiftDirection direction) {
148- auto next_monitor = g_pCompositor->getMonitorInDirection(shiftToMathDirection(direction));
149+ auto next_monitor = State::monitorState()
150+ ->query()
151+ .relativeTo(this->monitor().lock())
152+ .inDirection(shiftToMathDirection(direction))
153+ .run();
154
155 if (next_monitor) {
156 bool found = false;
157@@ -859,7 +866,12 @@ Hy3Node* Hy3Layout::focusMonitor(ShiftDirection direction) {
158 }
159
160 bool Hy3Layout::shiftMonitor(Hy3Node& node, ShiftDirection direction, bool follow) {
161- auto next_monitor = g_pCompositor->getMonitorInDirection(shiftToMathDirection(direction));
162+ auto next_monitor = State::monitorState()
163+ ->query()
164+ .relativeTo(this->monitor().lock())
165+ .inDirection(shiftToMathDirection(direction))
166+ .run();
167+
168
169 if (next_monitor) {
170 Desktop::focusState()->rawMonitorFocus(next_monitor);
171@@ -932,7 +944,7 @@ void Hy3Layout::moveNodeToWorkspace(
172 return;
173 }
174
175- auto workspace = g_pCompositor->getWorkspaceByID(target.id);
176+ auto workspace = State::workspaceState()->query().id(target.id).run();
177
178 if (origin == workspace.get()) return;
179
180@@ -949,7 +961,7 @@ void Hy3Layout::moveNodeToWorkspace(
181 if (workspace == nullptr) {
182 hy3_log(LOG, "creating target workspace {} for node move", target.id);
183
184- workspace = g_pCompositor->createNewWorkspace(target.id, origin_ws->monitorID(), target.name);
185+ workspace = State::workspaceState()->create(target.id, origin_ws->monitorID(), target.name);
186 }
187
188 if (focused_window != nullptr
189diff --git a/src/Hy3Layout.hpp b/src/Hy3Layout.hpp
190index 8506995652d31f212f0dd6a08039b2600cc61ab8..ae7fa993f76fd7697ac17d8e140e002a6565efc4 100644
191--- a/src/Hy3Layout.hpp
192+++ b/src/Hy3Layout.hpp
193@@ -14,6 +14,7 @@ enum class GroupEphemeralityOption {
194 #include <hyprland/src/layout/algorithm/TiledAlgorithm.hpp>
195 #include <hyprland/src/layout/algorithm/Algorithm.hpp>
196 #include <hyprland/src/layout/space/Space.hpp>
197+#include <hyprland/src/output/Monitor.hpp>
198 #include <hyprland/src/layout/target/Target.hpp>
199 #include <hyprland/src/layout/LayoutManager.hpp>
200 #include <hyprland/src/helpers/signal/Signal.hpp>
201@@ -180,7 +181,7 @@ public:
202 Hy3Node* getNodeFromTarget(SP<Layout::ITarget> target);
203
204 PHLWORKSPACE workspace();
205- CMonitor* monitor();
206+ PHLMONITORREF monitor();
207
208 UP<Hy3RootNode> root;
209
210diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
211index 0f9ffaf16c9e7fc97e1fa397c8c03156d9ecd31c..c1155e7dd0b2ad6abc91aa716143a4a91b4cd5e8 100644
212--- a/src/TabGroup.cpp
213+++ b/src/TabGroup.cpp
214@@ -494,7 +494,7 @@ void Hy3TabBar::updateNodeList(std::list<UP<Hy3Node>>& nodes) {
215 entry->setActive(active);
216
217 auto last_monitor = Desktop::focusState()->monitor();
218- entry->setMonitorActive(active && (!last_monitor || (*node)->layout()->monitor() == last_monitor.get()));
219+ entry->setMonitorActive(active && (!last_monitor || (*node)->layout()->monitor() == last_monitor));
220
221 entry->setUrgent((*node)->isUrgent());
222 entry->setWindowTitle((*node)->getTitle());