diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-09-26 09:37:28 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-09-26 09:50:33 -0400 |
commit | 3b62f2f01da84d78905f134cd0547a898eb236ee (patch) | |
tree | b0fd739a1254a9abdccf8cd42a88925b053b8d67 | |
parent | eea2e1c6319d79bbfc53c6f5c38aaf99a9501009 (diff) | |
download | gtk+-3b62f2f01da84d78905f134cd0547a898eb236ee.tar.gz |
GtkWindow: improve the inspector keybinding
Binding signals can return a boolean indicating whether they
handled the event. Use that here and return FALSE if the
inspector keybinding is disabled.
-rw-r--r-- | gtk/gtkwindow.c | 14 | ||||
-rw-r--r-- | gtk/gtkwindow.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 8099f3a059..22a95bfda1 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -416,7 +416,7 @@ static void gtk_window_real_set_focus (GtkWindow *window, static void gtk_window_real_activate_default (GtkWindow *window); static void gtk_window_real_activate_focus (GtkWindow *window); static void gtk_window_keys_changed (GtkWindow *window); -static void gtk_window_enable_debugging (GtkWindow *window, +static gboolean gtk_window_enable_debugging (GtkWindow *window, gboolean toggle); static gint gtk_window_draw (GtkWidget *widget, cairo_t *cr); @@ -1208,6 +1208,8 @@ gtk_window_class_init (GtkWindowClass *klass) * * The default bindings for this signal are Ctrl-Shift-I * and Ctrl-Shift-D. + * + * Return: %TRUE if the key binding was handled */ window_signals[ENABLE_DEBUGGING] = g_signal_new (I_("enable-debugging"), @@ -1215,8 +1217,8 @@ gtk_window_class_init (GtkWindowClass *klass) G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GtkWindowClass, enable_debugging), NULL, NULL, - _gtk_marshal_VOID__BOOLEAN, - G_TYPE_NONE, + _gtk_marshal_BOOLEAN__BOOLEAN, + G_TYPE_BOOLEAN, 1, G_TYPE_BOOLEAN); /* @@ -11773,14 +11775,14 @@ inspector_keybinding_enabled (gboolean *warn) return enabled; } -static void +static gboolean gtk_window_enable_debugging (GtkWindow *window, gboolean toggle) { gboolean warn; if (!inspector_keybinding_enabled (&warn)) - return; + return FALSE; if (toggle) { @@ -11792,6 +11794,8 @@ gtk_window_enable_debugging (GtkWindow *window, } else gtk_window_set_debugging (TRUE, TRUE, warn); + + return TRUE; } void diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 971609179d..687b312ba5 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -80,7 +80,7 @@ struct _GtkWindowClass void (* activate_focus) (GtkWindow *window); void (* activate_default) (GtkWindow *window); void (* keys_changed) (GtkWindow *window); - void (* enable_debugging) (GtkWindow *window, + gboolean (* enable_debugging) (GtkWindow *window, gboolean toggle); /*< private >*/ |