summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2008-02-12 10:02:46 +0000
committerMichael Natterer <mitch@src.gnome.org>2008-02-12 10:02:46 +0000
commitc3c1fb9822877d9aa0df2afec4412a38054ced41 (patch)
tree6d1a83ed936d9315127df3b1488df559ab050e10 /gtk/gtkwindow.c
parent2a0f1e7e213375c5471382328ad328a86306f20f (diff)
downloadgtk+-c3c1fb9822877d9aa0df2afec4412a38054ced41.tar.gz
simply use gtk_window_get_key_hash() to get the hash instead of manually
2008-02-12 Michael Natterer <mitch@imendio.com> * gtk/gtkwindow.c (gtk_window_activate_key): simply use gtk_window_get_key_hash() to get the hash instead of manually fiddling with quarks and gtk_window_keys_changed(). Also add g_return_if_fail() to this public function. svn path=/trunk/; revision=19521
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 58381d4324..f31f5c9e80 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7942,22 +7942,21 @@ gtk_window_free_key_hash (GtkWindow *window)
* called by the default ::key_press_event handler for toplevel windows,
* however in some cases it may be useful to call this directly when
* overriding the standard key handling for a toplevel window.
- *
+ *
* Return value: %TRUE if a mnemonic or accelerator was found and activated.
**/
gboolean
gtk_window_activate_key (GtkWindow *window,
GdkEventKey *event)
{
- GtkKeyHash *key_hash = g_object_get_qdata (G_OBJECT (window), quark_gtk_window_key_hash);
+ GtkKeyHash *key_hash;
GtkWindowKeyEntry *found_entry = NULL;
- if (!key_hash)
- {
- gtk_window_keys_changed (window);
- key_hash = g_object_get_qdata (G_OBJECT (window), quark_gtk_window_key_hash);
- }
-
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ key_hash = gtk_window_get_key_hash (window);
+
if (key_hash)
{
GSList *entries = _gtk_key_hash_lookup (key_hash,