[gnome-contacts/wip/nielsdg/fix-modifier] app: Don't add accelerators before startup()



commit 72453f62bdaca772dcc66c228fc3ff14359baf68
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun May 10 10:50:37 2020 +0200

    app: Don't add accelerators before startup()
    
    For certain accelerators (like `<Primary>`), GTK needs to be able to
    check the `GdkDisplay` under which it is running. Since this first needs
    `gtk_init()` to be called, we need to wait until the
    `GLib.Application.activate()` signal, where this call is done for us.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/169

 src/contacts-app.vala | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/contacts-app.vala b/src/contacts-app.vala
index 1044b3f..8cdf888 100644
--- a/src/contacts-app.vala
+++ b/src/contacts-app.vala
@@ -55,7 +55,6 @@ public class Contacts.App : Gtk.Application {
 
     this.settings = new Settings (this);
     add_main_option_entries (options);
-         create_actions ();
   }
 
   public override int command_line (ApplicationCommandLine command_line) {
@@ -267,14 +266,6 @@ public class Contacts.App : Gtk.Application {
     }
   }
 
-  private void create_actions () {
-    this.add_action_entries (action_entries, this);
-
-    this.set_accels_for_action ("app.help", {"F1"});
-    this.set_accels_for_action ("app.new-contact", {"<Primary>n"});
-    this.set_accels_for_action ("win.show-help-overlay", {"<Primary>question"});
-  }
-
   private void create_window () {
     this.window = new Contacts.Window (this.settings, this, this.contacts_store);
   }
@@ -343,6 +334,15 @@ public class Contacts.App : Gtk.Application {
     base.startup ();
 
     load_styling ();
+       create_actions ();
+  }
+
+  private void create_actions () {
+    this.add_action_entries (action_entries, this);
+
+    this.set_accels_for_action ("app.help", {"F1"});
+    this.set_accels_for_action ("app.new-contact", {"<Primary>n"});
+    this.set_accels_for_action ("win.show-help-overlay", {"<Primary>question"});
   }
 
   public void load_styling () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]