summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2025-11-19 03:21:28 -0500
committerlukefromdc <[email protected]>2025-11-19 03:21:28 -0500
commit733657220b8eccfb4aad2859375d00674742181e (patch)
tree4762fb66558474598296cff44385f5905baabdb1
parenta9341a107e8dfd336fb481d98659ec1399bf1442 (diff)
downloadmate-panel-wl-window-list-fix2.tar.bz2
mate-panel-wl-window-list-fix2.tar.xz
wl-window-list: ensure same behavior with and without show desktop applet in panelwl-window-list-fix2
*Note that in the wayland panel the show desktop applet works by using an invocation of the window list backend to send a signal to every window to mimimize or unminimize *This however causes every added button to be counted twice when the show desktop applet is also used *Detect the show desktop applet, and only divide the number of window list buttons by 2 when it is present
-rw-r--r--applets/wncklet/wayland-backend.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/applets/wncklet/wayland-backend.c b/applets/wncklet/wayland-backend.c
index 001149e7..30469894 100644
--- a/applets/wncklet/wayland-backend.c
+++ b/applets/wncklet/wayland-backend.c
@@ -68,6 +68,8 @@ typedef struct
gboolean fullscreen;
} ToplevelTask;
+static int tasklist_invocations = 0;
+
static const char *tasklist_manager_key = "tasklist_manager";
static const char *toplevel_task_key = "toplevel_task";
@@ -497,7 +499,12 @@ foreign_toplevel_handle_closed (void *data,
outer_box = gtk_widget_get_parent (GTK_WIDGET (task->button));
gtk_widget_destroy (task->button);
buttons = buttons -1;
- real_buttons = buttons / 2;
+
+ if (tasklist_invocations > 1)
+ real_buttons = buttons / 2;
+
+ else
+ real_buttons = buttons;
if (real_buttons == 0)
return;
@@ -704,7 +711,11 @@ toplevel_task_new (TasklistManager *tasklist, struct zwlr_foreign_toplevel_handl
if (tasklist_width <= 2)
tasklist_width = panel_width / 3;
- real_buttons = MAX ((buttons / 2), 1);
+ if (tasklist_invocations > 1)
+ real_buttons = MAX ((buttons / 2), 1);
+
+ else
+ real_buttons = MAX ((buttons), 1);
/*always allow at least three buttons to fit without adjustment
*so short window lists don't overflow
@@ -738,6 +749,8 @@ wayland_tasklist_new ()
{
wayland_tasklist_init_if_needed ();
TasklistManager *tasklist = tasklist_manager_new ();
+
+ tasklist_invocations = tasklist_invocations + 1;
if (!tasklist)
return gtk_label_new ("Shell does not support WLR Foreign Toplevel Control");
return tasklist->outer_box;