6bbb8071786d84afed9406864bbc0598d4a4ea00

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

Message

Merge latest changes into resize-by-keyboard

Diff

  1diff --git a/CHANGELOG.md b/CHANGELOG.md
  2index f30e22d5cedb190034e9fc7a40bf2286815da228..c97a0bf3baa11778fd3c84bb223dffd36f17f27e 100644
  3--- a/CHANGELOG.md
  4+++ b/CHANGELOG.md
  5@@ -2,12 +2,15 @@
  6 
  7 ## Upcoming
  8 
  9+- Implement `resizeactivewindow` for floating windows
 10+- Fully implement `resizeactivewindow` for tiled windows
 11+
 12+## hl0.35.0 and before
 13+
 14 - Fixed `hy3:killactive` and `hy3:movetoworkspace` not working in fullscreen.
 15 - `hy3:movetoworkspace` added to move a whole node to a workspace.
 16 - Newly tiled windows (usually from moving a window to a new workspace) are now
 17 placed relative to the last selected node.
 18-- Implement `resizeactivewindow` for floating windows
 19-- Fully implement `resizeactivewindow` for tiled windows
 20 
 21 ## hl0.34.0 and before
 22 *check commit history*
 23diff --git a/flake.lock b/flake.lock
 24index 216444c4372c7cf040758014c80050bad478ed35..410c5fe41ba94d8f44c26b4047602a1bf1f2a2c9 100644
 25--- a/flake.lock
 26+++ b/flake.lock
 27@@ -9,11 +9,11 @@
 28         "xdph": "xdph"
 29       },
 30       "locked": {
 31-        "lastModified": 1704110595,
 32-        "narHash": "sha256-WSrjBI3k2dM/kGF20At0E6NlrJSB4+pE+WGJ6dFzWEs=",
 33+        "lastModified": 1707098342,
 34+        "narHash": "sha256-dU5m6Cd4+WQZal2ICDVf1kww/dNzo1YUWRxWeCctEig=",
 35         "owner": "hyprwm",
 36         "repo": "Hyprland",
 37-        "rev": "03ebbe18ed8517ee22591eac82cd54322f42cb7d",
 38+        "rev": "84ab8d11e8951a6551d1e1bf87796a8589da6d47",
 39         "type": "github"
 40       },
 41       "original": {
 42@@ -47,13 +47,35 @@
 43         "type": "github"
 44       }
 45     },
 46+    "hyprlang": {
 47+      "inputs": {
 48+        "nixpkgs": [
 49+          "hyprland",
 50+          "xdph",
 51+          "nixpkgs"
 52+        ]
 53+      },
 54+      "locked": {
 55+        "lastModified": 1704287638,
 56+        "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
 57+        "owner": "hyprwm",
 58+        "repo": "hyprlang",
 59+        "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
 60+        "type": "github"
 61+      },
 62+      "original": {
 63+        "owner": "hyprwm",
 64+        "repo": "hyprlang",
 65+        "type": "github"
 66+      }
 67+    },
 68     "nixpkgs": {
 69       "locked": {
 70-        "lastModified": 1703438236,
 71-        "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
 72+        "lastModified": 1706191920,
 73+        "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=",
 74         "owner": "NixOS",
 75         "repo": "nixpkgs",
 76-        "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
 77+        "rev": "ae5c332cbb5827f6b1f02572496b141021de335f",
 78         "type": "github"
 79       },
 80       "original": {
 81@@ -87,18 +109,18 @@
 82       "flake": false,
 83       "locked": {
 84         "host": "gitlab.freedesktop.org",
 85-        "lastModified": 1701368958,
 86-        "narHash": "sha256-7kvyoA91etzVEl9mkA/EJfB6z/PltxX7Xc4gcr7/xlo=",
 87+        "lastModified": 1706359063,
 88+        "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=",
 89         "owner": "wlroots",
 90         "repo": "wlroots",
 91-        "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350",
 92+        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
 93         "type": "gitlab"
 94       },
 95       "original": {
 96         "host": "gitlab.freedesktop.org",
 97         "owner": "wlroots",
 98         "repo": "wlroots",
 99-        "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350",
100+        "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
101         "type": "gitlab"
102       }
103     },
104@@ -108,6 +130,7 @@
105           "hyprland",
106           "hyprland-protocols"
107         ],
108+        "hyprlang": "hyprlang",
109         "nixpkgs": [
110           "hyprland",
111           "nixpkgs"
112@@ -118,11 +141,11 @@
113         ]
114       },
115       "locked": {
116-        "lastModified": 1703514399,
117-        "narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=",
118+        "lastModified": 1706145785,
119+        "narHash": "sha256-j9MP4fv2U/vdRKAXXc2gyMTmYwVnHP6kHx1/y6jprrU=",
120         "owner": "hyprwm",
121         "repo": "xdg-desktop-portal-hyprland",
122-        "rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b",
123+        "rev": "5a592647587cd20b9692a347df6939b6d371b3bb",
124         "type": "github"
125       },
126       "original": {
127diff --git a/hyprpm.toml b/hyprpm.toml
128index c8fd12bb1e74c8fe2efebcc5c32ab0b228246fcb..012b379df6f2c7d7328bd6050acceb0c2c3e13bf 100644
129--- a/hyprpm.toml
130+++ b/hyprpm.toml
131@@ -2,7 +2,8 @@
132 name = "hy3"
133 authors = ["outfoxxed"]
134 commit_pins = [
135-	["03ebbe18ed8517ee22591eac82cd54322f42cb7d", "2f28dc810c0e1f42763a1f14fb011c4fce6db8be"]
136+	["03ebbe18ed8517ee22591eac82cd54322f42cb7d", "2f28dc810c0e1f42763a1f14fb011c4fce6db8be"],
137+	["84ab8d11e8951a6551d1e1bf87796a8589da6d47", "d3e20856a9896f28b506195b31407eddc6df2e20"]
138 ]
139 
140 [hy3]
141diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
142index a9e00de126de4063ce15f2ab54497dce67599095..f341ecedff46b0169b867e4607655f5157394aa7 100644
143--- a/src/Hy3Layout.cpp
144+++ b/src/Hy3Layout.cpp
145@@ -156,8 +156,10 @@ void Hy3Layout::insertNode(Hy3Node& node) {
146 		{
147 			opening_after = this->getNodeFromWindow(g_pCompositor->m_pLastWindow);
148 		} else {
149-			auto* mouse_window =
150-			    g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal());
151+			auto* mouse_window = g_pCompositor->vectorToWindowUnified(
152+			    g_pInputManager->getMouseCoordsInternal(),
153+			    RESERVED_EXTENTS | INPUT_EXTENTS
154+			);
155 
156 			if (mouse_window != nullptr && mouse_window->m_iWorkspaceID == node.workspace_id) {
157 				opening_after = this->getNodeFromWindow(mouse_window);
158@@ -180,8 +182,13 @@ void Hy3Layout::insertNode(Hy3Node& node) {
159 			static const auto* tab_first_window =
160 			    &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tab_first_window")->intValue;
161 
162+			auto width =
163+			    monitor->vecSize.x - monitor->vecReservedBottomRight.x - monitor->vecReservedTopLeft.x;
164+			auto height =
165+			    monitor->vecSize.y - monitor->vecReservedBottomRight.y - monitor->vecReservedTopLeft.y;
166+
167 			this->nodes.push_back({
168-			    .data = Hy3GroupLayout::SplitH,
169+			    .data = height > width ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH,
170 			    .position = monitor->vecPosition + monitor->vecReservedTopLeft,
171 			    .size = monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight,
172 			    .workspace_id = node.workspace_id,
173@@ -1112,8 +1119,13 @@ void Hy3Layout::focusTab(
174 	Hy3Node* tab_focused_node;
175 
176 	if (target == TabFocus::MouseLocation || mouse != TabFocusMousePriority::Ignore) {
177-		if (g_pCompositor->windowFloatingFromCursor() == nullptr) {
178-			auto mouse_pos = g_pInputManager->getMouseCoordsInternal();
179+		auto mouse_pos = g_pInputManager->getMouseCoordsInternal();
180+		if (g_pCompositor->vectorToWindowUnified(
181+		        mouse_pos,
182+		        RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING | FLOATING_ONLY
183+		    )
184+		    == nullptr)
185+		{
186 			tab_node = findTabBarAt(*node, mouse_pos, &tab_focused_node);
187 			if (tab_node != nullptr) goto hastab;
188 		}