From 0af3352de3b625d784f6599b9942f14dce3b756b Mon Sep 17 00:00:00 2001 From: Aaron Dill <117116764+aarondill@users.noreply.github.com> Date: Thu, 15 Jan 2026 00:25:50 -0600 Subject: [PATCH] Status Icon: Refactor info dialog to use Gtk.Dialog This gives the window the proper flags to be managed by window managers (most notably `WINDOW_TYPE = DIALOG`) --- src/redshift-gtk/statusicon.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py index b4adfb00..58d50477 100644 --- a/src/redshift-gtk/statusicon.py +++ b/src/redshift-gtk/statusicon.py @@ -117,14 +117,13 @@ def __init__(self, controller): self.status_menu.append(quit_item) # Create info dialog - self.info_dialog = Gtk.Window(title=_('Info')) + self.info_dialog = Gtk.Dialog(title=_('Info')) self.info_dialog.set_resizable(False) self.info_dialog.set_property('border-width', 6) self.info_dialog.connect('delete-event', self.close_info_dialog_cb) - content_area = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) - self.info_dialog.add(content_area) - content_area.show() + content_area = self.info_dialog.get_content_area() + content_area.set_spacing(6) self.status_label = Gtk.Label() self.status_label.set_alignment(0.0, 0.5) @@ -150,10 +149,8 @@ def __init__(self, controller): content_area.pack_start(self.period_label, True, True, 0) self.period_label.show() - self.close_button = Gtk.Button(label=_('Close')) - content_area.pack_start(self.close_button, True, True, 0) + self.close_button = self.info_dialog.add_button(_('Close'), Gtk.ResponseType.NONE) self.close_button.connect('clicked', self.close_info_dialog_cb) - self.close_button.show() # Setup signals to property changes self._controller.connect('inhibit-changed', self.inhibit_change_cb)