diff --git a/flake.lock b/flake.lock index 99cfb40..af24f17 100644 --- a/flake.lock +++ b/flake.lock @@ -4,15 +4,16 @@ "inputs": { "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs", + "systems": "systems", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1691612137, - "narHash": "sha256-7nMCJIZBB2XIjUqAjImoTaZBVIg/0REripGdNsClxlQ=", + "lastModified": 1692123043, + "narHash": "sha256-6YoTjAZgtJb9OzKrZxtLxjfYiGWSqMmh1Wyh9dvwXn8=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "126792584fa4eb25f6c8e3b3eb6bfb00b58a787a", + "rev": "4986d74ef201171a930c312a8e3b72a22d9b84ee", "type": "github" }, "original": { @@ -26,14 +27,18 @@ "nixpkgs": [ "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1684265364, - "narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=", + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", "type": "github" }, "original": { @@ -44,11 +49,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1690179384, - "narHash": "sha256-+arbgqFTAtoeKtepW9wCnA0njCOyoiDFyl0Q0SBSOtE=", + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b12803b6d90e2e583429bb79b859ca53c348b39a", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", "type": "github" }, "original": { @@ -63,6 +68,21 @@ "hyprland": "hyprland" } }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, "wlroots": { "flake": false, "locked": { @@ -91,14 +111,18 @@ "nixpkgs": [ "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1691082525, - "narHash": "sha256-C5AO0KnyAFJaCkOn+5nJfWm0kyiPn/Awh0lKTjhgr7Y=", + "lastModified": 1691841170, + "narHash": "sha256-RCTm1/MVWYPnReMgyp7tr2ogGYo/pvw38jZaFwemgPU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "42747d267ab4345c4ceb78cd4a4fe99f072d80fc", + "rev": "57a3a41ba6b358109e4fc25c6a4706b5f7d93c6b", "type": "github" }, "original": { diff --git a/src/Hy3Node.cpp b/src/Hy3Node.cpp index 327fac7..9e68cc2 100644 --- a/src/Hy3Node.cpp +++ b/src/Hy3Node.cpp @@ -323,26 +323,28 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { g_pHyprRenderer->damageBox(&box); } - // TODO: fix broken start positions when using hy3:expand, base - if (expand_focused) { - for (auto* child: group->children) { - if (child == group->focused_child) { - child->position = tpos; - child->size = tsize; - child->setHidden(hidden); + for (auto* child: group->children) { + if (expand_focused && child == group->focused_child) { + child->position = tpos; + child->size = tsize; + child->setHidden(hidden); - child->gap_pos_offset = gap_pos_offset; - child->gap_size_offset = gap_size_offset; - } else { - child->setHidden(true); - } + child->gap_pos_offset = gap_pos_offset; + child->gap_size_offset = gap_size_offset; child->recalcSizePosRecursive(no_animation); - } - } - for (auto* child: group->children) { + switch (group->layout) { + case Hy3GroupLayout::SplitH: offset += child->size.x; break; + case Hy3GroupLayout::SplitV: offset += child->size.y; break; + case Hy3GroupLayout::Tabbed: break; + } + + continue; + } + if (expand_focused && child == group->focused_child) continue; + auto was_hidden = child->hidden; switch (group->layout) { case Hy3GroupLayout::SplitH: @@ -351,7 +353,8 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { offset += child->size.x; child->position.y = tpos.y; child->size.y = tsize.y; - child->setHidden(this->hidden || expand_focused); + child->hidden = this->hidden || expand_focused; + // child->setHidden(this->hidden || expand_focused); if (group->children.size() == 1) { child->gap_pos_offset = gap_pos_offset; @@ -371,7 +374,7 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { child->gap_size_offset = Vector2D(0, gap_size_offset.y); } - child->recalcSizePosRecursive(no_animation); + child->recalcSizePosRecursive(no_animation || was_hidden); break; case Hy3GroupLayout::SplitV: child->position.y = tpos.y + offset; @@ -379,7 +382,8 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { offset += child->size.y; child->position.x = tpos.x; child->size.x = tsize.x; - child->setHidden(this->hidden || expand_focused); + child->hidden = this->hidden || expand_focused; + // child->setHidden(this->hidden || expand_focused); if (group->children.size() == 1) { child->gap_pos_offset = gap_pos_offset; @@ -399,17 +403,18 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) { child->gap_size_offset = Vector2D(gap_size_offset.x, 0); } - child->recalcSizePosRecursive(no_animation); + child->recalcSizePosRecursive(no_animation || was_hidden); break; case Hy3GroupLayout::Tabbed: child->position = tpos; child->size = tsize; - child->setHidden(this->hidden || expand_focused || group->focused_child != child); + child->hidden = this->hidden || expand_focused || group->focused_child != child; + // child->setHidden(this->hidden || expand_focused || group->focused_child != child); child->gap_pos_offset = Vector2D(gap_pos_offset.x, gap_pos_offset.y + tab_height_offset); child->gap_size_offset = Vector2D(gap_size_offset.x, gap_size_offset.y + tab_height_offset); - child->recalcSizePosRecursive(no_animation); + child->recalcSizePosRecursive(no_animation || was_hidden); break; } }