From acedb05a75a3a44c1a0f0f56842fe4e607324f4b Mon Sep 17 00:00:00 2001 From: q234rty Date: Tue, 6 Feb 2024 15:54:26 +0800 Subject: [PATCH 1/4] Fix building on Hyprland 0.35.0 Ref https://github.com/hyprwm/Hyprland/pull/4514 --- src/Hy3Layout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index bca5224..09ba804 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -157,7 +157,7 @@ void Hy3Layout::insertNode(Hy3Node& node) { opening_after = this->getNodeFromWindow(g_pCompositor->m_pLastWindow); } else { auto* mouse_window = - g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal()); + g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS); if (mouse_window != nullptr && mouse_window->m_iWorkspaceID == node.workspace_id) { opening_after = this->getNodeFromWindow(mouse_window); @@ -1227,8 +1227,8 @@ void Hy3Layout::focusTab( Hy3Node* tab_focused_node; if (target == TabFocus::MouseLocation || mouse != TabFocusMousePriority::Ignore) { - if (g_pCompositor->windowFloatingFromCursor() == nullptr) { - auto mouse_pos = g_pInputManager->getMouseCoordsInternal(); + auto mouse_pos = g_pInputManager->getMouseCoordsInternal(); + if (g_pCompositor->vectorToWindowUnified(mouse_pos, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING | FLOATING_ONLY) == nullptr) { tab_node = findTabBarAt(*node, mouse_pos, &tab_focused_node); if (tab_node != nullptr) goto hastab; } From d3e20856a9896f28b506195b31407eddc6df2e20 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 6 Feb 2024 13:40:44 -0800 Subject: [PATCH 2/4] Update flake reference to hyprland 0.35.0 --- flake.lock | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 216444c..410c5fe 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1704110595, - "narHash": "sha256-WSrjBI3k2dM/kGF20At0E6NlrJSB4+pE+WGJ6dFzWEs=", + "lastModified": 1707098342, + "narHash": "sha256-dU5m6Cd4+WQZal2ICDVf1kww/dNzo1YUWRxWeCctEig=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "03ebbe18ed8517ee22591eac82cd54322f42cb7d", + "rev": "84ab8d11e8951a6551d1e1bf87796a8589da6d47", "type": "github" }, "original": { @@ -47,13 +47,35 @@ "type": "github" } }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704287638, + "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1703438236, - "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", + "lastModified": 1706191920, + "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", + "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", "type": "github" }, "original": { @@ -87,18 +109,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1701368958, - "narHash": "sha256-7kvyoA91etzVEl9mkA/EJfB6z/PltxX7Xc4gcr7/xlo=", + "lastModified": 1706359063, + "narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=", "owner": "wlroots", "repo": "wlroots", - "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "5d639394f3e83b01596dcd166a44a9a1a2583350", + "rev": "00b869c1a96f300a8f25da95d624524895e0ddf2", "type": "gitlab" } }, @@ -108,6 +130,7 @@ "hyprland", "hyprland-protocols" ], + "hyprlang": "hyprlang", "nixpkgs": [ "hyprland", "nixpkgs" @@ -118,11 +141,11 @@ ] }, "locked": { - "lastModified": 1703514399, - "narHash": "sha256-VRr5Xc4S/VPr/gU3fiOD3vSIL2+GJ+LUrmFTWTwnTz4=", + "lastModified": 1706145785, + "narHash": "sha256-j9MP4fv2U/vdRKAXXc2gyMTmYwVnHP6kHx1/y6jprrU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "0a318a7a217a6402b0b705837cd5b50b0e94b31b", + "rev": "5a592647587cd20b9692a347df6939b6d371b3bb", "type": "github" }, "original": { From 107cb86304435368c68a4d8111cf01de628734b2 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 6 Feb 2024 13:56:26 -0800 Subject: [PATCH 3/4] Update to hyprland 0.35.0 --- CHANGELOG.md | 2 ++ hyprpm.toml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6b4c99..2038191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Upcoming +## hl0.35.0 and before + - Fixed `hy3:killactive` and `hy3:movetoworkspace` not working in fullscreen. - `hy3:movetoworkspace` added to move a whole node to a workspace. - Newly tiled windows (usually from moving a window to a new workspace) are now diff --git a/hyprpm.toml b/hyprpm.toml index c8fd12b..012b379 100644 --- a/hyprpm.toml +++ b/hyprpm.toml @@ -2,7 +2,8 @@ name = "hy3" authors = ["outfoxxed"] commit_pins = [ - ["03ebbe18ed8517ee22591eac82cd54322f42cb7d", "2f28dc810c0e1f42763a1f14fb011c4fce6db8be"] + ["03ebbe18ed8517ee22591eac82cd54322f42cb7d", "2f28dc810c0e1f42763a1f14fb011c4fce6db8be"], + ["84ab8d11e8951a6551d1e1bf87796a8589da6d47", "d3e20856a9896f28b506195b31407eddc6df2e20"] ] [hy3] From 7f1989689df71da8e2081dc24453ccd41341bf50 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 6 Feb 2024 14:36:11 -0800 Subject: [PATCH 4/4] Fix starting with a horizontal layout on vertical monitors --- src/Hy3Layout.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 09ba804..1a8948e 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -156,8 +156,10 @@ void Hy3Layout::insertNode(Hy3Node& node) { { opening_after = this->getNodeFromWindow(g_pCompositor->m_pLastWindow); } else { - auto* mouse_window = - g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS); + auto* mouse_window = g_pCompositor->vectorToWindowUnified( + g_pInputManager->getMouseCoordsInternal(), + RESERVED_EXTENTS | INPUT_EXTENTS + ); if (mouse_window != nullptr && mouse_window->m_iWorkspaceID == node.workspace_id) { opening_after = this->getNodeFromWindow(mouse_window); @@ -180,8 +182,13 @@ void Hy3Layout::insertNode(Hy3Node& node) { static const auto* tab_first_window = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tab_first_window")->intValue; + auto width = + monitor->vecSize.x - monitor->vecReservedBottomRight.x - monitor->vecReservedTopLeft.x; + auto height = + monitor->vecSize.y - monitor->vecReservedBottomRight.y - monitor->vecReservedTopLeft.y; + this->nodes.push_back({ - .data = Hy3GroupLayout::SplitH, + .data = height > width ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH, .position = monitor->vecPosition + monitor->vecReservedTopLeft, .size = monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight, .workspace_id = node.workspace_id, @@ -1228,7 +1235,12 @@ void Hy3Layout::focusTab( if (target == TabFocus::MouseLocation || mouse != TabFocusMousePriority::Ignore) { auto mouse_pos = g_pInputManager->getMouseCoordsInternal(); - if (g_pCompositor->vectorToWindowUnified(mouse_pos, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING | FLOATING_ONLY) == nullptr) { + if (g_pCompositor->vectorToWindowUnified( + mouse_pos, + RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING | FLOATING_ONLY + ) + == nullptr) + { tab_node = findTabBarAt(*node, mouse_pos, &tab_focused_node); if (tab_node != nullptr) goto hastab; }