[gtk/event-signal: 2/5] widget: Connect to GdkSurface::event



commit 944b4df31ebf3597275514dcad171b71fb6dee05
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Feb 23 13:49:28 2019 -0500

    widget: Connect to GdkSurface::event
    
    This lets us handle input events the same way
    we do expose events.

 gtk/gtkwidget.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a3a46f739f..3df19baf02 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11426,6 +11426,16 @@ surface_expose (GdkSurface     *surface,
   return TRUE;
 }
 
+static gboolean
+surface_event (GdkSurface *surface,
+               GdkEvent   *event,
+               GtkWidget  *widget)
+{
+  gtk_main_do_event (event);
+
+  return TRUE;
+}
+
 /**
  * gtk_widget_register_surface:
  * @widget: a #GtkWidget
@@ -11455,6 +11465,7 @@ gtk_widget_register_surface (GtkWidget    *widget,
   gdk_surface_set_user_data (surface, widget);
 
   g_signal_connect (surface, "render", G_CALLBACK (surface_expose), widget);
+  g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
 }
 
 /**


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