From 727cffe2ddc078a3b717c2818b11d1e49297d194 Mon Sep 17 00:00:00 2001 From: Evan Maddock Date: Fri, 24 Jan 2025 11:04:28 -0500 Subject: [PATCH 1/2] icon-tasklist: Remove last references to xid Signed-off-by: Evan Maddock --- .../applets/icon-tasklist/widgets/ButtonPopover.vala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala b/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala index 0dc4c47b6..78affb9ad 100644 --- a/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala +++ b/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala @@ -196,7 +196,7 @@ public class ButtonPopover : Gtk.Popover { controls_layout.destroy(); }); - string id = ((ulong) window.x11_get_xid()).to_string(); + string id = window.get_class_ids()[0]; stack.add_named(controls_layout, id); stack.set_visible_child_name(id); }); @@ -205,12 +205,12 @@ public class ButtonPopover : Gtk.Popover { } public void remove_window(libxfce4windowing.Window window) { - ulong window_id = (ulong) window.x11_get_xid(); + string window_id = window.get_class_ids()[0]; WindowItem? window_item = null; // Get the window item for this window, if exists foreach (var child in windows.get_children()) { - ulong child_id = (ulong) ((WindowItem) child).window.x11_get_xid(); + string child_id = ((WindowItem) child).window.get_class_ids()[0]; if (child_id == window_id) { window_item = child as WindowItem; break; @@ -257,6 +257,11 @@ private class WindowControls : Gtk.Box { relief = Gtk.ReliefStyle.NONE, }; + // Keep on top is not currently supported on Wayland + if (libxfce4windowing.windowing_get() == libxfce4windowing.Windowing.WAYLAND) { + keep_on_top_button.sensitive = false; + } + maximize_button = new Gtk.Button.with_label("") { relief = Gtk.ReliefStyle.NONE, }; From 05d2a4c51bb14e8a0d60e9c1d62a22c02bb74f89 Mon Sep 17 00:00:00 2001 From: Evan Maddock Date: Sat, 25 Jan 2025 14:01:52 -0500 Subject: [PATCH 2/2] icon-tasklist: Remove always-on-top button because there is no standard way to do that Signed-off-by: Evan Maddock --- .../icon-tasklist/widgets/ButtonPopover.vala | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala b/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala index 78affb9ad..493cacf66 100644 --- a/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala +++ b/src/panel/applets/icon-tasklist/widgets/ButtonPopover.vala @@ -241,7 +241,6 @@ public class ButtonPopover : Gtk.Popover { private class WindowControls : Gtk.Box { public libxfce4windowing.Window window { get; construct; } - private Gtk.CheckButton? keep_on_top_button; private Gtk.Button? maximize_button; private Gtk.Button? minimize_button; private Gtk.Button? return_button; @@ -253,15 +252,6 @@ private class WindowControls : Gtk.Box { } construct { - keep_on_top_button = new Gtk.CheckButton.with_label(_("Always on top")) { - relief = Gtk.ReliefStyle.NONE, - }; - - // Keep on top is not currently supported on Wayland - if (libxfce4windowing.windowing_get() == libxfce4windowing.Windowing.WAYLAND) { - keep_on_top_button.sensitive = false; - } - maximize_button = new Gtk.Button.with_label("") { relief = Gtk.ReliefStyle.NONE, }; @@ -281,7 +271,6 @@ private class WindowControls : Gtk.Box { selection_mode = Gtk.SelectionMode.NONE, }; - list_box.add(keep_on_top_button); list_box.add(maximize_button); list_box.add(minimize_button); @@ -290,14 +279,6 @@ private class WindowControls : Gtk.Box { pack_start(list_box); pack_end(return_button, false, false, 0); - keep_on_top_button.toggled.connect(() => { - try { - window.set_above(keep_on_top_button.active); - } catch (Error e) { - warning("Unable to set keep on top for window %s: %s", window.get_name(), e.message); - } - }); - maximize_button.clicked.connect(() => { var maximized = window.is_maximized();