diff --git a/CHANGELOG.md b/CHANGELOG.md index 52aa26a..aa889e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# 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 - Added `hy3:warpcursor` dispatcher to warp cursor to current node. diff --git a/README.md b/README.md index 2fc3f3b..0f86850 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 [issue #109](https://github.com/outfoxxed/hy3/issues/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] 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/Hy3Layout.cpp b/src/Hy3Layout.cpp index 12963f8..0bf5115 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); @@ -947,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); @@ -990,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; @@ -1009,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) { diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp index 02caeff..f892a83 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; } @@ -117,7 +121,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 +232,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 +248,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 149340d..70339c9 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