fixup: fix compile against hyprland 8a68199

This commit is contained in:
outfoxxed 2024-06-24 13:48:49 -07:00
parent 767eec5821
commit d0056945d0
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 54 additions and 55 deletions

46
flake.lock generated
View file

@ -16,11 +16,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717181720, "lastModified": 1718450675,
"narHash": "sha256-yv+QZWsusu/NWjydkxixHC2g+tIJ9v+xkE2EiVpJj6g=", "narHash": "sha256-jpsns6buS4bK+1sF8sL8AaixAiCRjA+nldTKvcwmvUs=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprcursor", "repo": "hyprcursor",
"rev": "9e27a2c2ceb1e0b85bd55b0afefad196056fe87c", "rev": "66d5b46ff94efbfa6fa3d1d1b66735f1779c34a6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -40,16 +40,16 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1718272446, "lastModified": 1719164993,
"narHash": "sha256-hLnnNBWP1Qjs1I3fndMgp8rbWJruxdnGTq77A4Rv4R4=", "narHash": "sha256-FABhTnL6CBNrvsHVrEXWYoH+zrNfA4yPmgorQupUSZo=",
"rev": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", "rev": "8a68199a0ceb2894a5d9cc300961c38123ac0312",
"revCount": 4818, "revCount": 4879,
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
}, },
"original": { "original": {
"rev": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", "rev": "8a68199a0ceb2894a5d9cc300961c38123ac0312",
"submodules": true, "submodules": true,
"type": "git", "type": "git",
"url": "https://github.com/hyprwm/Hyprland" "url": "https://github.com/hyprwm/Hyprland"
@ -69,11 +69,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1691753796, "lastModified": 1714869498,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", "narHash": "sha256-vbLVOWvQqo4n1yvkg/Q70VTlPbMmTiCQfNTgcWDCfJM=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", "rev": "e06482e0e611130cd1929f75e8c1cf679e57d161",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -123,11 +123,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717881334, "lastModified": 1718804078,
"narHash": "sha256-a0inRgJhPL6v9v7RPM/rx1kbXdfe3xJA1c9z0ZkYnh4=", "narHash": "sha256-CqRZne63BpYlPd/i8lXV0UInUt59oKogiwdVtBRHt60=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "0693f9398ab693d89c9a0aa3b3d062dd61b7a60e", "rev": "4f1351295c55a8f51219b25aa4a6497a067989d0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -148,11 +148,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717784906, "lastModified": 1718119275,
"narHash": "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM=", "narHash": "sha256-nqDYXATNkyGXVmNMkT19fT4sjtSPBDS1LLOxa3Fueo4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwayland-scanner", "repo": "hyprwayland-scanner",
"rev": "0f30f9eca6e404130988554accbb64d1c9ec877d", "rev": "1419520d5f7f38d35e05504da5c1b38212a38525",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -163,11 +163,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717974879, "lastModified": 1718530797,
"narHash": "sha256-GTO3C88+5DX171F/gVS3Qga/hOs/eRMxPFpiHq2t+D8=", "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c7b821ba2e1e635ba5a76d299af62821cbcb09f3", "rev": "b60ebf54c15553b393d144357375ea956f89e9a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -214,11 +214,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1717918856, "lastModified": 1718619174,
"narHash": "sha256-I38bmPLqamvOfVSArd1hhZtkVRAYBK38fOHZCU1P9Qg=", "narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "72907822c19afc0983c69d59d299204381623725", "rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,6 +1,6 @@
{ {
inputs = { 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 outputs = { self, hyprland, ... }: let

View file

@ -549,14 +549,14 @@ void Hy3Layout::fullscreenRequestForWindow(
// clang-format off // clang-format off
auto gap_pos_offset = Vector2D( auto gap_pos_offset = Vector2D(
-(gaps_in->left - gaps_out->left), (int) -(gaps_in->left - gaps_out->left),
-(gaps_in->top - gaps_out->top) (int) -(gaps_in->top - gaps_out->top)
); );
// clang-format on // clang-format on
auto gap_size_offset = Vector2D( auto gap_size_offset = Vector2D(
-(gaps_in->left - gaps_out->left) + -(gaps_in->right - gaps_out->right), (int) (-(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->top - gaps_out->top) + -(gaps_in->bottom - gaps_out->bottom))
); );
Hy3Node fakeNode = { Hy3Node fakeNode = {
@ -968,15 +968,14 @@ void changeNodeWorkspaceRecursive(Hy3Node& node, const PHLWORKSPACE& workspace)
} }
void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsname, bool follow) { void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsname, bool follow) {
std::string target_name; auto target = getWorkspaceIDNameFromString(wsname);
auto target_id = getWorkspaceIDFromString(wsname, target_name);
if (target_id == WORKSPACE_INVALID) { if (target.id == WORKSPACE_INVALID) {
hy3_log(ERR, "moveNodeToWorkspace called with invalid workspace {}", wsname); hy3_log(ERR, "moveNodeToWorkspace called with invalid workspace {}", wsname);
return; return;
} }
auto workspace = g_pCompositor->getWorkspaceByID(target_id); auto workspace = g_pCompositor->getWorkspaceByID(target.id);
if (origin == workspace) return; if (origin == workspace) return;
@ -991,9 +990,9 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna
if (!valid(origin_ws)) return; if (!valid(origin_ws)) return;
if (workspace == nullptr) { 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 // floating or fullscreen
@ -1583,10 +1582,12 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
auto calcPos = window->m_vPosition; auto calcPos = window->m_vPosition;
auto calcSize = window->m_vSize; 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 = auto gaps_offset_bottomright =
Vector2D(gaps_in->left + gaps_in->right, gaps_in->top + gaps_in->bottom) Vector2D((int) (gaps_in->left + gaps_in->right), (int) (gaps_in->top + gaps_in->bottom))
+ node->gap_bottomright_offset + node->gap_topleft_offset; + node->gap_bottomright_offset + node->gap_topleft_offset;
calcPos = calcPos + gaps_offset_topleft; calcPos = calcPos + gaps_offset_topleft;
calcSize = calcSize - gaps_offset_bottomright; calcSize = calcSize - gaps_offset_bottomright;

View file

@ -5,8 +5,8 @@
#include <bits/ranges_util.h> #include <bits/ranges_util.h>
#include <hyprland/src/Compositor.hpp> #include <hyprland/src/Compositor.hpp>
#include <hyprland/src/defines.hpp> #include <hyprland/src/defines.hpp>
#include <hyprland/src/helpers/Box.hpp>
#include <hyprland/src/plugins/PluginAPI.hpp> #include <hyprland/src/plugins/PluginAPI.hpp>
#include <hyprutils/math/Box.hpp>
#include "Hy3Layout.hpp" #include "Hy3Layout.hpp"
#include "Hy3Node.hpp" #include "Hy3Node.hpp"
@ -304,17 +304,15 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) {
static const auto group_inset = ConfigValue<Hyprlang::INT>("plugin:hy3:group_inset"); static const auto group_inset = ConfigValue<Hyprlang::INT>("plugin:hy3:group_inset");
static const auto tab_bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height"); static const auto tab_bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height");
static const auto tab_bar_padding = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:padding"); static const auto tab_bar_padding = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:padding");
// clang-format on
// clang-format off
auto gap_topleft_offset = Vector2D( auto gap_topleft_offset = Vector2D(
-(gaps_in->left - gaps_out->left), (int) -(gaps_in->left - gaps_out->left),
-(gaps_in->top - gaps_out->top) (int) -(gaps_in->top - gaps_out->top)
); );
auto gap_bottomright_offset = Vector2D( auto gap_bottomright_offset = Vector2D(
-(gaps_in->right - gaps_out->right), (int) -(gaps_in->right - gaps_out->right),
-(gaps_in->bottom - gaps_out->bottom) (int) -(gaps_in->bottom - gaps_out->bottom)
); );
// clang-format on // clang-format on
@ -447,16 +445,16 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) {
if (this->parent != nullptr) child->gap_bottomright_offset.x += *group_inset; if (this->parent != nullptr) child->gap_bottomright_offset.x += *group_inset;
} else if (child == group.children.front()) { } else if (child == group.children.front()) {
child->gap_topleft_offset = gap_topleft_offset; 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; child->size.x += gap_topleft_offset.x;
offset += gap_topleft_offset.x; offset += gap_topleft_offset.x;
} else if (child == group.children.back()) { } 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->gap_bottomright_offset = gap_bottomright_offset;
child->size.x += gap_bottomright_offset.x; child->size.x += gap_bottomright_offset.x;
} else { } else {
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 = Vector2D(0, gap_bottomright_offset.y); child->gap_bottomright_offset = Vector2D(0.0, gap_bottomright_offset.y);
} }
child->recalcSizePosRecursive(no_animation); 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; if (this->parent != nullptr) child->gap_bottomright_offset.y += *group_inset;
} else if (child == group.children.front()) { } else if (child == group.children.front()) {
child->gap_topleft_offset = gap_topleft_offset; 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; child->size.y += gap_topleft_offset.y;
offset += gap_topleft_offset.y; offset += gap_topleft_offset.y;
} else if (child == group.children.back()) { } 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->gap_bottomright_offset = gap_bottomright_offset;
child->size.y += gap_bottomright_offset.y; child->size.y += gap_bottomright_offset.y;
} else { } else {
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 = Vector2D(gap_bottomright_offset.x, 0); child->gap_bottomright_offset = Vector2D(gap_bottomright_offset.x, 0.0);
} }
child->recalcSizePosRecursive(no_animation); child->recalcSizePosRecursive(no_animation);

View file

@ -4,15 +4,15 @@
#include <hyprland/src/Compositor.hpp> #include <hyprland/src/Compositor.hpp>
#include <hyprland/src/desktop/DesktopTypes.hpp> #include <hyprland/src/desktop/DesktopTypes.hpp>
#include <hyprland/src/desktop/Workspace.hpp> #include <hyprland/src/desktop/Workspace.hpp>
#include <hyprland/src/helpers/Box.hpp>
#include <hyprland/src/helpers/Color.hpp> #include <hyprland/src/helpers/Color.hpp>
#include <hyprland/src/render/OpenGL.hpp> #include <hyprland/src/render/OpenGL.hpp>
#include <hyprland/src/render/Texture.hpp>
#include <hyprutils/memory/SharedPtr.hpp> #include <hyprutils/memory/SharedPtr.hpp>
#include <hyprutils/math/Box.hpp>
#include <pango/pangocairo.h> #include <pango/pangocairo.h>
#include <pixman.h> #include <pixman.h>
#include "globals.hpp" #include "globals.hpp"
#include "src/render/Texture.hpp"
Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) { Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) {
this->focused this->focused
@ -419,7 +419,7 @@ void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
static const auto bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height"); static const auto bar_height = ConfigValue<Hyprlang::INT>("plugin:hy3:tabs:height");
auto& gaps = node.parent == nullptr ? gaps_out : gaps_in; 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 // clang-format off
auto tsize = Vector2D( auto tsize = Vector2D(