Skip to content

Commit

Permalink
AppChooser: fix warning
Browse files Browse the repository at this point in the history
Only grab default after all widgets are inside the window.
  • Loading branch information
Marukesu authored and danirabbit committed Nov 24, 2021
1 parent dbe6d0b commit f84b985
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/AppChooser/Dialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f84b985

Please sign in to comment.