After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700079 - Fix accels added after the window was shown not working
Fix accels added after the window was shown not working
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-05-10 14:09 UTC by Bastien Nocera
Modified: 2013-05-13 06:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix accels added after the window was shown not working (2.84 KB, patch)
2013-05-10 14:09 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-05-10 14:09:14 UTC
Was the problem in Totem with accels coming from plugins.
Comment 1 Bastien Nocera 2013-05-10 14:09:16 UTC
Created attachment 243785 [details] [review]
Fix accels added after the window was shown not working

GtkApplicationWindow would only update its list of captured accels
when realizing the window. This meant that keyboard shortcuts added
after the window was realised (for example, added by plugins) would
be non-functional.

Solve this by updating our accels every time the accel map changes,
not only when realizing the window.
Comment 2 Matthias Clasen 2013-05-12 15:44:46 UTC
Review of attachment 243785 [details] [review]:

Looks good, for master and 3.8

::: gtk/gtkapplicationwindow.c
@@ +763,3 @@
   gtk_application_window_update_accels (window);
+  accel_map = gtk_accel_map_get ();
+  window->priv->accel_map_changed_id = g_signal_connect_swapped (G_OBJECT (accel_map), "changed",

No cast necessary for g_signal_connect and friends - they all take a gpointer.
Without the cast, I'd get rid of the accel_map variable too.
Comment 3 Bastien Nocera 2013-05-13 06:58:20 UTC
Pushed to master and gtk-3-8 with the fix mentioned in the review.

Attachment 243785 [details] pushed as 2f1d718 - Fix accels added after the window was shown not working