From f84b9851501e36c61a7c8ad9bf5027ee3b0569fb Mon Sep 17 00:00:00 2001 From: Marukesu Date: Tue, 23 Nov 2021 23:07:48 -0300 Subject: [PATCH] AppChooser: fix warning Only grab default after all widgets are inside the window. --- src/AppChooser/Dialog.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AppChooser/Dialog.vala b/src/AppChooser/Dialog.vala index b836eafd..0d6032e0 100644 --- a/src/AppChooser/Dialog.vala +++ b/src/AppChooser/Dialog.vala @@ -123,8 +123,7 @@ public class AppChooser.Dialog : Hdy.Window { var cancel = new Gtk.Button.with_label (_("Cancel")); open_button = new Gtk.Button.with_label (_("Open")) { - can_default = true, - has_default = true + can_default = true }; open_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION); @@ -159,6 +158,8 @@ public class AppChooser.Dialog : Hdy.Window { default_width = 350; modal = true; + open_button.grab_default (); + realize.connect (() => { if (parent_window != "") { var parent = ExternalWindow.from_handle (parent_window);