[gtk+] gtkwindow: run ::event and specific handlers for EWMH action triggering events



commit 6b7b55f9b2b9eb7e05f68e932f9c804cb7ada412
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Sep 16 21:19:40 2014 +0200

    gtkwindow: run ::event and specific handlers for EWMH action triggering events
    
    This gives an opportunity for implementations to handle these events
    differently, instead of hardcoding the WM-triggering behavior.
    
    gtk_window_event() only forwards events for WM management if the event
    widget is not the window (ie. caught when bubbling), so is safe to be
    called here without triggering gtk_window_handle_wm_event() twice.
    
    This commit is an adaption to master of
    https://bugzilla.gnome.org/show_bug.cgi?id=736702#c1 by Cosimo Cecchi.

 gtk/gtkwindow.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c0943d2..35832c5 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7654,6 +7654,14 @@ _gtk_window_check_handle_wm_event (GdkEvent *event)
   if (!GTK_IS_WINDOW (widget))
     return GDK_EVENT_PROPAGATE;
 
+  if (event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE &&
+      event->type != GDK_MOTION_NOTIFY && event->type != GDK_TOUCH_BEGIN &&
+      event->type != GDK_TOUCH_END && event->type != GDK_TOUCH_UPDATE)
+    return GDK_EVENT_PROPAGATE;
+
+  if (gtk_widget_event (widget, event))
+    return GDK_EVENT_STOP;
+
   return gtk_window_handle_wm_event (GTK_WINDOW (widget), event);
 }
 


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