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
This commit is contained in:
Michael Natterer 2008-02-12 10:02:46 +00:00 committed by Michael Natterer
parent 2a0f1e7e21
commit c3c1fb9822
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,10 @@
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.
2008-02-11 Matthias Clasen <mclasen@redhat.com>
Support keynav in status icons. (#473786, Li Yuan)

View File

@ -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,