diff options
author | Ryan Lortie <desrt@desrt.ca> | 2010-10-20 23:58:20 +0200 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2010-10-20 23:58:20 +0200 |
commit | 56d2590b493ec3d010246d805628f76c216803a1 (patch) | |
tree | f26fb64e90fbe85933debd04080902cc45152dae /gtk/gtkimcontextsimple.c | |
parent | 3fcec464ac59b39d3aef7185611cfed90a43332f (diff) | |
download | gtk+-56d2590b493ec3d010246d805628f76c216803a1.tar.gz |
GtkIMContextSimple: avoid gdk_window_get_user_data
We lookup a widget to call a function on GtkWidget that ends up just
performing an operation directly on the GdkWindow again anyway
(beeping). There's already fallback code at the point of the call that
does exactly that anyway, so just do that all of the time.
Diffstat (limited to 'gtk/gtkimcontextsimple.c')
-rw-r--r-- | gtk/gtkimcontextsimple.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index fac41e7594..d9c70e5b67 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -692,26 +692,15 @@ check_hex (GtkIMContextSimple *context_simple, static void beep_window (GdkWindow *window) { - GtkWidget *widget; + GdkScreen *screen = gdk_window_get_screen (GDK_DRAWABLE (window)); + gboolean beep; - gdk_window_get_user_data (window, (gpointer) &widget); + g_object_get (gtk_settings_get_for_screen (screen), + "gtk-error-bell", &beep, + NULL); - if (GTK_IS_WIDGET (widget)) - { - gtk_widget_error_bell (widget); - } - else - { - GdkScreen *screen = gdk_window_get_screen (GDK_DRAWABLE (window)); - gboolean beep; - - g_object_get (gtk_settings_get_for_screen (screen), - "gtk-error-bell", &beep, - NULL); - - if (beep) - gdk_window_beep (window); - } + if (beep) + gdk_window_beep (window); } static gboolean |