[gtk+/saved/mir: 12/47] Use event queue (sort of) correctly



commit fe477552e1a64acdf9cdc3b0d6f935c4e01a7a80
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue May 27 11:16:20 2014 +0200

    Use event queue (sort of) correctly

 gdk/mir/gdkmirdisplay.c    |    2 +-
 gdk/mir/gdkmirwindowimpl.c |   15 ++++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gdk/mir/gdkmirdisplay.c b/gdk/mir/gdkmirdisplay.c
index ea00bd6..aaf02bb 100644
--- a/gdk/mir/gdkmirdisplay.c
+++ b/gdk/mir/gdkmirdisplay.c
@@ -198,7 +198,7 @@ gdk_mir_display_has_pending (GdkDisplay *display)
 static void
 gdk_mir_display_queue_events (GdkDisplay *display)
 {
-  g_printerr ("gdk_mir_display_queue_events\n");
+  //g_printerr ("gdk_mir_display_queue_events\n");
   /* We don't need to poll for events - so don't do anything*/
 }
 
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 6542df0..f2f1f79 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -387,9 +387,18 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
   event->any.window = g_object_ref (window);
 
   display = gdk_window_get_display (window);
-  _gdk_event_emit (event);
-  //node = _gdk_event_queue_append (display, event);
-  //_gdk_windowing_got_event (display, node, event, _gdk_display_get_next_serial (display));
+  node = _gdk_event_queue_append (display, event);
+  _gdk_windowing_got_event (display, node, event, _gdk_display_get_next_serial (display));
+  while (TRUE)
+    {
+      GdkEvent *e;
+
+      e = gdk_display_get_event (display);
+      if (!e)
+        break;
+      _gdk_event_emit (e);
+      gdk_event_free (e);
+    }
 }
 
 static void


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