From d0056945d088c984232216c82e19428b9981fafc Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 24 Jun 2024 13:48:49 -0700 Subject: [PATCH] fixup: fix compile against hyprland 8a68199 --- flake.lock | 46 +++++++++++++++++++++++----------------------- flake.nix | 2 +- src/Hy3Layout.cpp | 27 ++++++++++++++------------- src/Hy3Node.cpp | 28 +++++++++++++--------------- src/TabGroup.cpp | 6 +++--- 5 files changed, 54 insertions(+), 55 deletions(-) diff --git a/flake.lock b/flake.lock index a929c20..7de4a6a 100644 --- a/flake.lock +++ b/flake.lock @@ -16,11 +16,11 @@ ] }, "locked": { - "lastModified": 1717181720, - "narHash": "sha256-yv+QZWsusu/NWjydkxixHC2g+tIJ9v+xkE2EiVpJj6g=", + "lastModified": 1718450675, + "narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "9e27a2c2ceb1e0b85bd55b0afefad196056fe87c", + "rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6", "type": "github" }, "original": { @@ -40,16 +40,16 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1718272446, - "narHash": "sha256-hLnnNBWP1Qjs1I3fndMgp8rbWJruxdnGTq77A4Rv4R4=", - "rev": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", - "revCount": 4818, + "lastModified": 1719164993, + "narHash": "sha256-FABhTnL6CBNrvsHVrEXWYoH+zrNfA4yPmgorQupUSZo=", + "rev": "8a68199a0ceb2894a5d9cc300961c38123ac0312", + "revCount": 4879, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" }, "original": { - "rev": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", + "rev": "8a68199a0ceb2894a5d9cc300961c38123ac0312", "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -69,11 +69,11 @@ ] }, "locked": { - "lastModified": 1691753796, - "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "lastModified": 1714869498, + "narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "rev": "e06482e0e611130cd1929f75e8c1cf679e57d161", "type": "github" }, "original": { @@ -123,11 +123,11 @@ ] }, "locked": { - "lastModified": 1717881334, - "narHash": "sha256-a0inRgJhPL6v9v7RPM/rx1kbXdfe3xJA1c9z0ZkYnh4=", + "lastModified": 1718804078, + "narHash": "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "0693f9398ab693d89c9a0aa3b3d062dd61b7a60e", + "rev": "4f1351295c55a8f51219b25aa4a6497a067989d0", "type": "github" }, "original": { @@ -148,11 +148,11 @@ ] }, "locked": { - "lastModified": 1717784906, - "narHash": "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM=", + "lastModified": 1718119275, + "narHash": "sha256-nqDYXATNkyGXVmNMkT19fT4sjtSPBDS1LLOxa3Fueo4=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "0f30f9eca6e404130988554accbb64d1c9ec877d", + "rev": "1419520d5f7f38d35e05504da5c1b38212a38525", "type": "github" }, "original": { @@ -163,11 +163,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1717974879, - "narHash": "sha256-GTO3C88+5DX171F/gVS3Qga/hOs/eRMxPFpiHq2t+D8=", + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c7b821ba2e1e635ba5a76d299af62821cbcb09f3", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "type": "github" }, "original": { @@ -214,11 +214,11 @@ ] }, "locked": { - "lastModified": 1717918856, - "narHash": "sha256-I38bmPLqamvOfVSArd1hhZtkVRAYBK38fOHZCU1P9Qg=", + "lastModified": 1718619174, + "narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "72907822c19afc0983c69d59d299204381623725", + "rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0f81af8..6d21cf4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&rev=9e781040d9067c2711ec2e9f5b47b76ef70762b3"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1&rev=8a68199a0ceb2894a5d9cc300961c38123ac0312"; }; outputs = { self, hyprland, ... }: let diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index b05a5d6..a4f075e 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -549,14 +549,14 @@ void Hy3Layout::fullscreenRequestForWindow( // clang-format off auto gap_pos_offset = Vector2D( - -(gaps_in->left - gaps_out->left), - -(gaps_in->top - gaps_out->top) + (int) -(gaps_in->left - gaps_out->left), + (int) -(gaps_in->top - gaps_out->top) ); // clang-format on auto gap_size_offset = Vector2D( - -(gaps_in->left - gaps_out->left) + -(gaps_in->right - gaps_out->right), - -(gaps_in->top - gaps_out->top) + -(gaps_in->bottom - gaps_out->bottom) + (int) (-(gaps_in->left - gaps_out->left) + -(gaps_in->right - gaps_out->right)), + (int) (-(gaps_in->top - gaps_out->top) + -(gaps_in->bottom - gaps_out->bottom)) ); Hy3Node fakeNode = { @@ -968,15 +968,14 @@ void changeNodeWorkspaceRecursive(Hy3Node& node, const PHLWORKSPACE& workspace) } void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsname, bool follow) { - std::string target_name; - auto target_id = getWorkspaceIDFromString(wsname, target_name); + auto target = getWorkspaceIDNameFromString(wsname); - if (target_id == WORKSPACE_INVALID) { + if (target.id == WORKSPACE_INVALID) { hy3_log(ERR, "moveNodeToWorkspace called with invalid workspace {}", wsname); return; } - auto workspace = g_pCompositor->getWorkspaceByID(target_id); + auto workspace = g_pCompositor->getWorkspaceByID(target.id); if (origin == workspace) return; @@ -991,9 +990,9 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna if (!valid(origin_ws)) return; if (workspace == nullptr) { - hy3_log(LOG, "creating target workspace {} for node move", target_id); + hy3_log(LOG, "creating target workspace {} for node move", target.id); - workspace = g_pCompositor->createNewWorkspace(target_id, origin_ws->m_iMonitorID, target_name); + workspace = g_pCompositor->createNewWorkspace(target.id, origin_ws->m_iMonitorID, target.name); } // floating or fullscreen @@ -1583,10 +1582,12 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) { auto calcPos = window->m_vPosition; auto calcSize = window->m_vSize; - auto gaps_offset_topleft = Vector2D(gaps_in->left, gaps_in->top) + node->gap_topleft_offset; + auto gaps_offset_topleft = + Vector2D((int) gaps_in->left, (int) gaps_in->top) + node->gap_topleft_offset; + auto gaps_offset_bottomright = - Vector2D(gaps_in->left + gaps_in->right, gaps_in->top + gaps_in->bottom) - + node->gap_bottomright_offset + node->gap_topleft_offset; + Vector2D((int) (gaps_in->left + gaps_in->right), (int) (gaps_in->top + gaps_in->bottom)) + + node->gap_bottomright_offset + node->gap_topleft_offset; calcPos = calcPos + gaps_offset_topleft; calcSize = calcSize - gaps_offset_bottomright; diff --git a/src/Hy3Node.cpp b/src/Hy3Node.cpp index 5a9dd3d..32a9394 100644 --- a/src/Hy3Node.cpp +++ b/src/Hy3Node.cpp @@ -5,8 +5,8 @@ #include #include #include -#include #include +#include #include "Hy3Layout.hpp" #include "Hy3Node.hpp" @@ -304,17 +304,15 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { static const auto group_inset = ConfigValue("plugin:hy3:group_inset"); static const auto tab_bar_height = ConfigValue("plugin:hy3:tabs:height"); static const auto tab_bar_padding = ConfigValue("plugin:hy3:tabs:padding"); - // clang-format on - // clang-format off auto gap_topleft_offset = Vector2D( - -(gaps_in->left - gaps_out->left), - -(gaps_in->top - gaps_out->top) + (int) -(gaps_in->left - gaps_out->left), + (int) -(gaps_in->top - gaps_out->top) ); auto gap_bottomright_offset = Vector2D( - -(gaps_in->right - gaps_out->right), - -(gaps_in->bottom - gaps_out->bottom) + (int) -(gaps_in->right - gaps_out->right), + (int) -(gaps_in->bottom - gaps_out->bottom) ); // clang-format on @@ -447,16 +445,16 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { if (this->parent != nullptr) child->gap_bottomright_offset.x += *group_inset; } else if (child == group.children.front()) { child->gap_topleft_offset = gap_topleft_offset; - child->gap_bottomright_offset = Vector2D(0, gap_bottomright_offset.y); + child->gap_bottomright_offset = Vector2D(0.0, gap_bottomright_offset.y); child->size.x += gap_topleft_offset.x; offset += gap_topleft_offset.x; } else if (child == group.children.back()) { - child->gap_topleft_offset = Vector2D(0, gap_topleft_offset.y); + child->gap_topleft_offset = Vector2D(0.0, gap_topleft_offset.y); child->gap_bottomright_offset = gap_bottomright_offset; child->size.x += gap_bottomright_offset.x; } else { - child->gap_topleft_offset = Vector2D(0, gap_topleft_offset.y); - child->gap_bottomright_offset = Vector2D(0, gap_bottomright_offset.y); + child->gap_topleft_offset = Vector2D(0.0, gap_topleft_offset.y); + child->gap_bottomright_offset = Vector2D(0.0, gap_bottomright_offset.y); } child->recalcSizePosRecursive(no_animation); @@ -476,16 +474,16 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { if (this->parent != nullptr) child->gap_bottomright_offset.y += *group_inset; } else if (child == group.children.front()) { child->gap_topleft_offset = gap_topleft_offset; - child->gap_bottomright_offset = Vector2D(gap_bottomright_offset.x, 0); + child->gap_bottomright_offset = Vector2D(gap_bottomright_offset.x, 0.0); child->size.y += gap_topleft_offset.y; offset += gap_topleft_offset.y; } else if (child == group.children.back()) { - child->gap_topleft_offset = Vector2D(gap_topleft_offset.x, 0); + child->gap_topleft_offset = Vector2D(gap_topleft_offset.x, 0.0); child->gap_bottomright_offset = gap_bottomright_offset; child->size.y += gap_bottomright_offset.y; } else { - child->gap_topleft_offset = Vector2D(gap_topleft_offset.x, 0); - child->gap_bottomright_offset = Vector2D(gap_bottomright_offset.x, 0); + child->gap_topleft_offset = Vector2D(gap_topleft_offset.x, 0.0); + child->gap_bottomright_offset = Vector2D(gap_bottomright_offset.x, 0.0); } child->recalcSizePosRecursive(no_animation); diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 2e384bf..76184ee 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -4,15 +4,15 @@ #include #include #include -#include #include #include +#include #include +#include #include #include #include "globals.hpp" -#include "src/render/Texture.hpp" Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) { this->focused @@ -419,7 +419,7 @@ void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) { static const auto bar_height = ConfigValue("plugin:hy3:tabs:height"); auto& gaps = node.parent == nullptr ? gaps_out : gaps_in; - auto tpos = node.position + Vector2D(gaps->left, gaps->top) + node.gap_topleft_offset; + auto tpos = node.position + Vector2D((int) gaps->left, (int) gaps->top) + node.gap_topleft_offset; // clang-format off auto tsize = Vector2D(