12a73ab0adddbc39f839da320dcc2b028769fc58

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

Message

fixup: chase git

Diff

  1diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
  2index 7f91608a20b5b1a41f5845b6f3c3df7362658f3b..f2f47a19475aaecaf9aea8396cd145a20fd0655f 100644
  3--- a/src/Hy3Layout.cpp
  4+++ b/src/Hy3Layout.cpp
  5@@ -13,6 +13,7 @@
  6 #include <hyprland/src/config/ConfigManager.hpp>
  7 #include <hyprland/src/desktop/DesktopTypes.hpp>
  8 #include <hyprland/src/desktop/Workspace.hpp>
  9+#include <hyprland/src/desktop/view/window/WindowPresentation.hpp>
 10 #include <hyprland/src/desktop/rule/Engine.hpp>
 11 #include <hyprland/src/managers/SeatManager.hpp>
 12 #include <hyprland/src/managers/fullscreen/FullscreenController.hpp>
 13@@ -114,7 +115,7 @@ Hy3Layout::Hy3Layout() {
 14 
 15 		    auto view = ptr_surface->view();
 16 		    auto* window = dynamic_cast<Desktop::View::CWindow*>(view.get());
 17-		    if (!window || window->m_isFloating || Fullscreen::controller()->isFullscreen(window->m_self.lock())) return;
 18+		    if (!window || window->isFloating() || Fullscreen::controller()->isFullscreen(window->m_self.lock())) return;
 19 
 20 		    auto* node = this->getNodeFromWindow(window);
 21 		    if (!node) return;
 22@@ -418,7 +419,7 @@ void Hy3Layout::updateGroupBorderColors() {
 23 			w.m_ruleApplicator->inactiveBorderColor().unset(Desktop::Types::PRIORITY_LAYOUT);
 24 		}
 25 
 26-		w.updateDecorationValues();
 27+		w.presentation().refreshValues();
 28 	}
 29 }
 30 
 31@@ -597,8 +598,8 @@ PHLWINDOW Hy3Layout::findTiledWindowCandidate(const CWindow* from) {
 32 PHLWINDOW Hy3Layout::findFloatingWindowCandidate(const CWindow* from) {
 33 	// return the first floating window on the same workspace that has not asked not to be focused
 34 	for (const auto& w: Desktop::windowState()->windows() | std::views::reverse) {
 35-		if (w->m_isMapped && !w->isHidden() && w->m_isFloating && !w->isX11OverrideRedirect()
 36-		    && w->m_workspace == from->m_workspace && !w->m_X11ShouldntFocus
 37+		if (w->mapped() && !w->isHidden() && w->isFloating() && !w->backend().traits().overrideRedirect
 38+		    && w->m_workspace == from->m_workspace && !w->shouldntFocus()
 39 		    && !w->m_ruleApplicator->noFocus().valueOrDefault() && w.get() != from)
 40 		{
 41 			return w;
 42@@ -793,7 +794,7 @@ void Hy3Layout::shiftFocus(
 43 			return;
 44 		}
 45 
 46-		if (current_window->m_isFloating) {
 47+		if (current_window->isFloating()) {
 48 			auto next_window = Desktop::windowState()->query().inDirection(
 49 			    current_window,
 50 			    shiftToMathDirection(direction)
 51@@ -802,7 +803,10 @@ void Hy3Layout::shiftFocus(
 52 			if (next_window != nullptr) {
 53 				g_pInputManager->unconstrainMouse();
 54 				Desktop::focusState()->fullWindowFocus(next_window, Desktop::FOCUS_REASON_KEYBIND);
 55-				if (warp) Hy3Layout::warpCursorToBox(next_window->m_reportedPosition, next_window->m_reportedSize);
 56+				if (warp) {
 57+					const auto box = next_window->layoutBox();
 58+					Hy3Layout::warpCursorToBox(box.pos(), box.size());
 59+				}
 60 			}
 61 			return;
 62 		}
 63@@ -889,7 +893,7 @@ void Hy3Layout::toggleFocusLayer(const CWorkspace* workspace, bool warp) {
 64 	if (!current_window) return;
 65 
 66 	PHLWINDOW target;
 67-	if (current_window->m_isFloating) {
 68+	if (current_window->isFloating()) {
 69 		target = this->findTiledWindowCandidate(current_window.get());
 70 	} else {
 71 		target = this->findFloatingWindowCandidate(current_window.get());
 72@@ -1150,7 +1154,7 @@ void Hy3Layout::focusTab(
 73 		// non window-parented surface focused, cant have a tab
 74 		auto view = ptrSurface->view();
 75 		auto* window = dynamic_cast<CWindow*>(view.get());
 76-		if (!window || window->m_isFloating) return;
 77+		if (!window || window->isFloating()) return;
 78 
 79 		auto mouse_pos = g_pInputManager->getMouseCoordsInternal();
 80 		tab_node = findTabBarAt(*node, mouse_pos, &tab_focused_node);
 81@@ -1239,7 +1243,7 @@ void Hy3Layout::setNodeSwallow(const CWorkspace* workspace, SetSwallowOption opt
 82 
 83 void Hy3Layout::killFocusedNode(const CWorkspace* workspace) {
 84 	auto last_window = Desktop::focusState()->window();
 85-	if (last_window != nullptr && last_window->m_isFloating) {
 86+	if (last_window != nullptr && last_window->isFloating()) {
 87 		last_window->sendClose();
 88 	} else {
 89 		auto* node = this->getWorkspaceFocusedNode(workspace);
 90diff --git a/src/Hy3Node.cpp b/src/Hy3Node.cpp
 91index 7e4b3609d8a02c328d4d7a626f6bc6f905529746..c55ff1f3e33a1fc83592bce0bcdf281b00e6a0e7 100644
 92--- a/src/Hy3Node.cpp
 93+++ b/src/Hy3Node.cpp
 94@@ -7,6 +7,7 @@
 95 #include <hyprland/src/desktop/state/FocusState.hpp>
 96 #include <hyprland/src/config/ConfigManager.hpp>
 97 #include <hyprland/src/defines.hpp>
 98+#include <hyprland/src/desktop/view/window/WindowPresentation.hpp>
 99 #include <hyprland/src/plugins/PluginAPI.hpp>
100 #include <hyprland/src/config/shared/workspace/WorkspaceRuleManager.hpp>
101 #include <hyprutils/math/Box.hpp>
102@@ -241,7 +242,10 @@ void Hy3Node::focus(bool warp, Desktop::eFocusReason reason) {
103 		auto window = this->as_window();
104 		window->setHidden(false);
105 		Desktop::focusState()->fullWindowFocus(window, reason);
106-		if (warp) Hy3Layout::warpCursorToBox(window->m_reportedPosition, window->m_reportedSize);
107+		if (warp) {
108+			const auto box = window->layoutBox();
109+			Hy3Layout::warpCursorToBox(box.pos(), box.size());
110+		}
111 		break;
112 	}
113 	case Hy3NodeType::Group: {
114@@ -531,7 +535,7 @@ void Hy3Node::updateTabBarRecursive() {
115 void Hy3Node::updateDecos() {
116 	switch (this->type()) {
117 	case Hy3NodeType::Target:
118-		this->as_window()->updateDecorationValues();
119+		this->as_window()->presentation().refreshValues();
120 		break;
121 	case Hy3NodeType::Group:
122 		for (auto& child: this->as_group().children) {
123@@ -544,7 +548,7 @@ void Hy3Node::updateDecos() {
124 
125 std::string Hy3Node::getTitle() {
126 	switch (this->type()) {
127-	case Hy3NodeType::Target: return this->as_window()->m_title;
128+	case Hy3NodeType::Target: return this->as_window()->metadata().title();
129 	case Hy3NodeType::Group:
130 		std::string title;
131 		auto& group = this->as_group();
132@@ -570,7 +574,7 @@ std::string Hy3Node::getTitle() {
133 
134 bool Hy3Node::isUrgent() {
135 	for (auto& window: this->windows()) {
136-		if (window.m_isUrgent) return true;
137+		if (window.m_hints & Desktop::View::WINDOW_HINT_URGENT) return true;
138 	}
139 	return false;
140 }
141@@ -953,4 +957,3 @@ void Hy3Node::resize(ShiftDirection direction, double delta, bool no_animation)
142 		}
143 	}
144 }
145-
146diff --git a/src/Hy3Node.hpp b/src/Hy3Node.hpp
147index 67635fc782ee50d3f39093abe0c5ecf90751bfb2..7c2b8bfcb945fb64847ab1a2cb69b1aa7539468a 100644
148--- a/src/Hy3Node.hpp
149+++ b/src/Hy3Node.hpp
150@@ -9,7 +9,7 @@ enum class Hy3GroupLayout;
151 #include <generator>
152 
153 #include <hyprland/src/defines.hpp>
154-#include <hyprland/src/desktop/view/Window.hpp>
155+#include <hyprland/src/desktop/view/window/Window.hpp>
156 #include <hyprland/src/layout/target/Target.hpp>
157 
158 #include "Hy3Layout.hpp"
159diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
160index 8a5f63855b178f54fb1fe85f089e34b5a697744e..7f9fbd189b0d079b81e1524347009b48c318facc 100644
161--- a/src/TabGroup.cpp
162+++ b/src/TabGroup.cpp
163@@ -11,6 +11,7 @@
164 #include <hyprland/src/config/ConfigManager.hpp>
165 #include <hyprland/src/desktop/DesktopTypes.hpp>
166 #include <hyprland/src/desktop/Workspace.hpp>
167+#include <hyprland/src/desktop/view/window/WindowPresentation.hpp>
168 #include <hyprland/src/desktop/view/types/Geometric.hpp>
169 #include <hyprland/src/helpers/Color.hpp>
170 #include <hyprland/src/animation/AnimationManager.hpp>
171@@ -804,8 +805,8 @@ void Hy3TabGroup::renderTabBar() {
172 			auto wsize = window->size(IGeometric::GEOMETRIC_CURRENT);
173 
174 			CBox window_box = {wpos.x, wpos.y, wsize.x, wsize.y};
175-			auto border = window->getRealBorderSize();
176-			auto radius = *window_rounding + border;
177+			auto border = window->presentation().borderSize();
178+			auto radius = sc<int>(*window_rounding) + border;
179 			window_box.expand(border);
180 			// scaleBox(&window_box, scale);
181 			window_box.scale(scale);
182diff --git a/src/main.cpp b/src/main.cpp
183index e94689eef0bbfbffb571b07479e492d38f5f2666..288e70a8a5c2c0c8bd5634719b6276cae9aca276 100644
184--- a/src/main.cpp
185+++ b/src/main.cpp
186@@ -133,7 +133,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
187 
188 	g_urgentListener = Event::bus()->m_events.window.urgent.listen([](PHLWINDOW window) {
189 		if (!window) return;
190-		window->m_isUrgent = true;
191+		window->m_hints |= Desktop::View::WINDOW_HINT_URGENT;
192 		auto* hy3 = hy3InstanceForWorkspace(window->m_workspace);
193 		if (!hy3) return;
194 		auto* node = hy3->getNodeFromWindow(window.get());