[gtk+] mir: handle new MirCloseSurfaceEvent



commit 9abf990656b69a4704b8ba40733d920da879711f
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Fri Dec 5 15:53:03 2014 +0100

    mir: handle new MirCloseSurfaceEvent

 gdk/mir/gdkmir-debug.c      |   10 ++++++++++
 gdk/mir/gdkmireventsource.c |   11 +++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gdk/mir/gdkmir-debug.c b/gdk/mir/gdkmir-debug.c
index ef57eff..4dd3ece 100644
--- a/gdk/mir/gdkmir-debug.c
+++ b/gdk/mir/gdkmir-debug.c
@@ -270,6 +270,13 @@ _gdk_mir_print_resize_event (const MirResizeEvent *event)
 }
 
 void
+_gdk_mir_print_close_event (const MirCloseSurfaceEvent *event)
+{
+  g_printerr ("CLOSED\n");
+  g_printerr (" Surface %i\n", event->surface_id);
+}
+
+void
 _gdk_mir_print_event (const MirEvent *event)
 {
   switch (event->type)
@@ -286,6 +293,9 @@ _gdk_mir_print_event (const MirEvent *event)
     case mir_event_type_resize:
       _gdk_mir_print_resize_event (&event->resize);
       break;
+    case mir_event_type_close_surface:
+      _gdk_mir_print_close_event (&event->close_surface);
+      break;
     default:
       g_printerr ("EVENT %u\n", event->type);
       break;
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
index 68b0430..caa07b1 100644
--- a/gdk/mir/gdkmireventsource.c
+++ b/gdk/mir/gdkmireventsource.c
@@ -391,6 +391,14 @@ handle_resize_event (GdkWindow            *window,
   generate_configure_event (window, event->width, event->height);
 }
 
+static void
+handle_close_event (GdkWindow                  *window,
+                    const MirCloseSurfaceEvent *event)
+{
+  send_event (window, get_pointer (window), gdk_event_new (GDK_DESTROY));
+  gdk_window_destroy_notify (window);
+}
+
 typedef struct
 {
   GdkWindow *window;
@@ -423,6 +431,9 @@ gdk_mir_event_source_queue_event (GdkDisplay     *display,
     case mir_event_type_orientation:
       // FIXME?
       break;
+    case mir_event_type_close_surface:
+      handle_close_event (window, &event->close_surface);
+      break;
     default:
       g_warning ("Ignoring unknown Mir event %d", event->type);
       // FIXME?


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