From 202e02191a56bcc68f012e24a4fd45dbf9092e30 Mon Sep 17 00:00:00 2001 From: lenemter Date: Sat, 9 Mar 2024 21:15:35 +0900 Subject: [PATCH] PopoverManager: simplify `make_modal` --- src/Services/PopoverManager.vala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Services/PopoverManager.vala b/src/Services/PopoverManager.vala index a690cf5a..26e57363 100644 --- a/src/Services/PopoverManager.vala +++ b/src/Services/PopoverManager.vala @@ -55,7 +55,7 @@ public class Wingpanel.Services.PopoverManager : Object { popover.relative_to = _current_indicator; update_has_tooltip (_current_indicator.display_widget, false); owner.set_expanded (true); - make_modal (popover, true); + make_modal (true); owner.present (); popover.popup (); popover.show_all (); @@ -86,7 +86,7 @@ public class Wingpanel.Services.PopoverManager : Object { }); popover.closed.connect (() => { - make_modal (popover, false); + make_modal (false); }); popover.unmap.connect (() => { if (!grabbed) { @@ -174,8 +174,8 @@ public class Wingpanel.Services.PopoverManager : Object { } } - private void make_modal (Gtk.Popover? pop, bool modal = true) { - if (pop == null || pop.get_window () == null || mousing) { + private void make_modal (bool modal) { + if (popover == null || popover.get_window () == null || mousing) { return; } @@ -183,7 +183,7 @@ public class Wingpanel.Services.PopoverManager : Object { grabbed = true; Gtk.grab_add (owner); owner.set_focus (null); - pop.grab_focus (); + popover.grab_focus (); } else if (!modal && grabbed) { grabbed = false; Gtk.grab_remove (owner);