From de58d24c294b4dfad4d10492b67ac39c2c0944cb Mon Sep 17 00:00:00 2001 From: tuxx Date: Sun, 19 May 2024 23:37:49 +0200 Subject: [PATCH 1/6] Update README.md Added hyprpm update -f to readme according to bug in #109 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2fc3f3b..875675d 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,12 @@ To update hy3 (and all other plugins), run hyprpm update ``` +Sometimes the headers from hyprland are not updated, if this happens run (See #109 for an example of where this happened) + +```sh +hyprpm update -f +``` + (See [the wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/) for details.) > [!WARNING] From c9405564c880a0e6cef0e6413fb175812c85fa8e Mon Sep 17 00:00:00 2001 From: tuxx Date: Sun, 19 May 2024 23:39:08 +0200 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 875675d..0f86850 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ To update hy3 (and all other plugins), run hyprpm update ``` -Sometimes the headers from hyprland are not updated, if this happens run (See #109 for an example of where this happened) +Sometimes the headers from hyprland are not updated, if this happens run (See [issue #109](https://github.com/outfoxxed/hy3/issues/109) for an example of where this happened) ```sh hyprpm update -f From 2728dbed6a2a038fc542ef5837af4a185146ce4d Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 7 Jun 2024 13:16:59 -0700 Subject: [PATCH 3/6] fix: emit fullscreen event and update window rules+decos on fullscreen --- CHANGELOG.md | 3 +++ src/Hy3Layout.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52aa26a..31c6a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +# Upcoming +- Fixed IPC and wlr-foreign-toplevel not getting fullscreen and maximize events. + ## hl0.40.0 and before - Added `hy3:warpcursor` dispatcher to warp cursor to current node. diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index 12963f8..dad8404 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -503,6 +503,12 @@ void Hy3Layout::fullscreenRequestForWindow( window->m_bIsFullscreen = on; window->m_pWorkspace->m_bHasFullscreenWindow = !window->m_pWorkspace->m_bHasFullscreenWindow; + window->updateDynamicRules(); + window->updateWindowDecos(); + + g_pEventManager->postEvent(SHyprIPCEvent {"fullscreen", std::to_string((int) on)}); + EMIT_HOOK_EVENT("fullscreen", window); + if (!window->m_bIsFullscreen) { auto* node = this->getNodeFromWindow(window); From cf919397d4a80f2ae5e2c56e33979fc91d7fd78b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 7 Jun 2024 14:10:23 -0700 Subject: [PATCH 4/6] fix: moveNodeToWorkspace breakage across monitors (hy3 dispatchers) --- CHANGELOG.md | 1 + src/Hy3Layout.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c6a96..aa889e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Upcoming - Fixed IPC and wlr-foreign-toplevel not getting fullscreen and maximize events. +- Fixed glitches when moving nodes between monitors with hy3 dispatchers. ## hl0.40.0 and before diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp index dad8404..0bf5115 100644 --- a/src/Hy3Layout.cpp +++ b/src/Hy3Layout.cpp @@ -953,9 +953,12 @@ void changeNodeWorkspaceRecursive(Hy3Node& node, const PHLWORKSPACE& workspace) if (node.data.is_window()) { auto window = node.data.as_window(); + g_pHyprRenderer->damageWindow(window); window->moveToWorkspace(workspace); + window->m_iMonitorID = workspace->m_iMonitorID; window->updateToplevel(); window->updateDynamicRules(); + window->uncacheWindowDecos(); } else { for (auto* child: node.data.as_group().children) { changeNodeWorkspaceRecursive(*child, workspace); @@ -996,6 +999,7 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna if (focused_window != nullptr && (focused_window_node == nullptr || focused_window->m_bIsFullscreen)) { + g_pHyprRenderer->damageWindow(focused_window); g_pCompositor->moveWindowToWorkspaceSafe(focused_window, workspace); } else { if (node == nullptr) return; @@ -1015,6 +1019,8 @@ void Hy3Layout::moveNodeToWorkspace(const PHLWORKSPACE& origin, std::string wsna changeNodeWorkspaceRecursive(*node, workspace); this->insertNode(*node); + g_pCompositor->updateWorkspaceWindows(origin->m_iID); + g_pCompositor->updateWorkspaceWindows(workspace->m_iID); } if (follow) { From 144176a37a2d098bcda857653043d2685a1a0f9a Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 9 Jun 2024 18:11:42 -0700 Subject: [PATCH 5/6] fixup: fix compile against 1423707 Fixes #177 --- flake.lock | 32 ++++++++++++++++---------------- src/TabGroup.cpp | 8 ++++---- src/TabGroup.hpp | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index e7610a4..72bae96 100644 --- a/flake.lock +++ b/flake.lock @@ -16,11 +16,11 @@ ] }, "locked": { - "lastModified": 1716327911, - "narHash": "sha256-PI+wygItS/TKzi4gEAROvKTUzTx9GT+PGBttS/IOA/Q=", + "lastModified": 1717181720, + "narHash": "sha256-yv+QZWsusu/NWjydkxixHC2g+tIJ9v+xkE2EiVpJj6g=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "27ca640abeef2d425b5dbecf804f5eb622cef56d", + "rev": "9e27a2c2ceb1e0b85bd55b0afefad196056fe87c", "type": "github" }, "original": { @@ -39,11 +39,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1716491954, - "narHash": "sha256-Qf1mEPacXhhM5KFm7HG2F/UBfzkjSBK57gKquA5TAVY=", + "lastModified": 1717970802, + "narHash": "sha256-kFnaAmte/N1mrbHEQyrwDu9+laZzVAi4N2nQodCNfgg=", "ref": "refs/heads/main", - "rev": "4e42107d25dc47ee94da282db233f85f1e4c6bd0", - "revCount": 4733, + "rev": "1423707dbefc0329e80895451903a77ab684f7ea", + "revCount": 4789, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -93,11 +93,11 @@ ] }, "locked": { - "lastModified": 1715791527, - "narHash": "sha256-HhQ4zvGHrRjR63ltySSeg+x+0jb0lepiutWdnFhLRoo=", + "lastModified": 1716473782, + "narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "969cb076e5b76f2e823aeca1937a3e1f159812ee", + "rev": "87d5d984109c839482b88b4795db073eb9ed446f", "type": "github" }, "original": { @@ -118,11 +118,11 @@ ] }, "locked": { - "lastModified": 1716058375, - "narHash": "sha256-CwjWoVnBZE5SBpRx9dgSQGCr4Goxyfcyv3zZbOhVqzk=", + "lastModified": 1717784906, + "narHash": "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "3afed4364790aebe0426077631af1e164a9650cc", + "rev": "0f30f9eca6e404130988554accbb64d1c9ec877d", "type": "github" }, "original": { @@ -133,11 +133,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1716330097, - "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", "type": "github" }, "original": { diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 86eb679..2d51f59 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -117,7 +117,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) { auto rounding = std::min((double) *s_rounding * scale, std::min(width * 0.5, height * 0.5)); - if (this->texture.m_iTexID == 0 + if (this->texture->m_iTexID == 0 // clang-format off || this->last_render.x != box.x || this->last_render.y != box.y @@ -228,9 +228,9 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) { cairo_surface_flush(cairo_surface); auto data = cairo_image_surface_get_data(cairo_surface); - this->texture.allocate(); + this->texture->allocate(); - glBindTexture(GL_TEXTURE_2D, this->texture.m_iTexID); + glBindTexture(GL_TEXTURE_2D, this->texture->m_iTexID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -244,7 +244,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) { cairo_destroy(cairo); cairo_surface_destroy(cairo_surface); } else { - glBindTexture(GL_TEXTURE_2D, this->texture.m_iTexID); + glBindTexture(GL_TEXTURE_2D, this->texture->m_iTexID); } } diff --git a/src/TabGroup.hpp b/src/TabGroup.hpp index 12117f3..0fe1d95 100644 --- a/src/TabGroup.hpp +++ b/src/TabGroup.hpp @@ -15,7 +15,7 @@ class Hy3TabBar; struct Hy3TabBarEntry { std::string window_title; bool destroying = false; - CTexture texture; + SP texture; CAnimatedVariable focused; CAnimatedVariable urgent; CAnimatedVariable offset; // 0.0-1.0 of total bar From 45c6d01fbee2a0849c6b805d53e535ef5ea18466 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 10 Jun 2024 02:48:47 -0700 Subject: [PATCH 6/6] fix: crash on creating tab bars --- src/TabGroup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 2d51f59..caa9b2f 100644 --- a/src/TabGroup.cpp +++ b/src/TabGroup.cpp @@ -11,6 +11,8 @@ #include #include "globals.hpp" +#include "src/helpers/memory/SharedPtr.hpp" +#include "src/render/Texture.hpp" Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) { this->focused @@ -52,6 +54,8 @@ Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_b this->vertical_pos = 0.0; this->fade_opacity = 1.0; + + this->texture = makeShared(); } bool Hy3TabBarEntry::operator==(const Hy3Node& node) const { return this->node == node; }