diff --git a/CHANGELOG.md b/CHANGELOG.md index f30e22d..c97a0bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,15 @@ ## Upcoming +- Implement `resizeactivewindow` for floating windows +- Fully implement `resizeactivewindow` for tiled windows + +## 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 placed relative to the last selected node. -- Implement `resizeactivewindow` for floating windows -- Fully implement `resizeactivewindow` for tiled windows ## hl0.34.0 and before *check commit history* 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": { 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] diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index a9e00de..f341ece 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->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal()); + 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, @@ -1112,8 +1119,13 @@ 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; }