From 107dc080e283d1dcc8c6e5b11196c4c81ca528e0 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Thu, 30 May 2024 04:30:59 +0200 Subject: [PATCH] PanelWindow: Make struts more reliable (#1935) --- src/ShellClients/PanelWindow.vala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ShellClients/PanelWindow.vala b/src/ShellClients/PanelWindow.vala index 391577f4..6feef519 100644 --- a/src/ShellClients/PanelWindow.vala +++ b/src/ShellClients/PanelWindow.vala @@ -49,6 +49,10 @@ public class Gala.PanelWindow : Object { var monitor_manager = wm.get_display ().get_context ().get_backend ().get_monitor_manager (); monitor_manager.monitors_changed.connect (() => update_anchor (anchor)); + + var workspace_manager = wm.get_display ().get_workspace_manager (); + workspace_manager.workspace_added.connect (update_strut); + workspace_manager.workspace_removed.connect (update_strut); } #if HAS_MUTTER46 @@ -102,6 +106,8 @@ public class Gala.PanelWindow : Object { warning ("Side not supported yet"); break; } + + update_strut (); } #if HAS_MUTTER45 @@ -146,11 +152,14 @@ public class Gala.PanelWindow : Object { } private void make_exclusive () { - window.size_changed.connect (update_strut); update_strut (); } private void update_strut () { + if (clone.hide_mode != NEVER) { + return; + } + var rect = get_custom_window_rect (); Meta.Strut strut = { @@ -177,7 +186,6 @@ public class Gala.PanelWindow : Object { private void unmake_exclusive () { if (window in window_struts) { - window.size_changed.disconnect (update_strut); window_struts.remove (window); update_struts (); }