[gtk+] window: Handle manually bubbled events

commit 00656ed10bc108734a6bf677bb897d3de98bf891
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jun 2 17:55:26 2014 +0200

    window: Handle manually bubbled events
    The multipress gesture must react to either direct events on the
    GtkWindow (special cased through _gtk_widget_check_handle_wm_event),
    or bubbled events from child widgets. Ensure bubbled events go
    through the gesture, those are fed manually to make sure events are
    only handled once, in either one or other place. The implicit grab
    will ensure that doesn't change mid-action.

 gtk/gtkwindow.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index bd0d0c2..604fece 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -403,6 +403,8 @@ static gboolean gtk_window_map_event      (GtkWidget         *widget,
                                            GdkEventAny       *event);
 static gint gtk_window_configure_event    (GtkWidget         *widget,
                                           GdkEventConfigure *event);
+static gboolean gtk_window_event          (GtkWidget         *widget,
+                                           GdkEvent          *event);
 static gint gtk_window_key_press_event    (GtkWidget         *widget,
                                           GdkEventKey       *event);
 static gint gtk_window_key_release_event  (GtkWidget         *widget,
@@ -685,6 +687,7 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->unrealize = gtk_window_unrealize;
   widget_class->size_allocate = gtk_window_size_allocate;
   widget_class->configure_event = gtk_window_configure_event;
+  widget_class->event = gtk_window_event;
   widget_class->key_press_event = gtk_window_key_press_event;
   widget_class->key_release_event = gtk_window_key_release_event;
   widget_class->focus_in_event = gtk_window_focus_in_event;
@@ -7910,6 +7913,16 @@ _gtk_window_check_handle_wm_event (GdkEvent *event)
   return gtk_window_handle_wm_event (GTK_WINDOW (widget), event);
+static gboolean
+gtk_window_event (GtkWidget *widget,
+                  GdkEvent  *event)
+  if (widget != gtk_get_event_widget (event))
+    return gtk_window_handle_wm_event (GTK_WINDOW (widget), event);
 static void
 gtk_window_real_activate_default (GtkWindow *window)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]