[gtk+/gtk-3-22] mir: don't create GDK_INPUT_ONLY windows



commit e63d4111a44bbcbb46039c1c94cbb64747b33140
Author: William Hua <william hua canonical com>
Date:   Sat Mar 4 10:13:01 2017 -0500

    mir: don't create GDK_INPUT_ONLY windows

 gdk/mir/gdkmirwindowimpl.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index e270e72..53b6ce7 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -552,6 +552,9 @@ ensure_mir_window_full (GdkWindow      *window,
   GdkMirWindowReference *window_ref;
   MirWindowSpec *spec;
 
+  if (window->input_only)
+    return;
+
   if (impl->mir_window)
     {
       if (impl->pending_spec_update)
@@ -641,7 +644,8 @@ send_buffer (GdkWindow *window)
   GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
 
   /* Send the completed buffer to Mir */
-  mir_buffer_stream_swap_buffers_sync (mir_window_get_buffer_stream (impl->mir_window));
+  if (impl->mir_window)
+    mir_buffer_stream_swap_buffers_sync (mir_window_get_buffer_stream (impl->mir_window));
 
   /* The Cairo context is no longer valid */
   g_clear_pointer (&impl->cairo_surface, cairo_surface_destroy);
@@ -668,6 +672,9 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
 
   ensure_mir_window (window);
 
+  if (!impl->mir_window)
+    return NULL;
+
   if (window->gl_paint_context)
     {
       cairo_surface = cairo_image_surface_create (pixel_format, window->width, window->height);
@@ -775,12 +782,12 @@ gdk_mir_window_impl_show (GdkWindow *window,
   ensure_mir_window (window);
 
   if (!window->gl_paint_context)
-  {
-    /* Make sure something is rendered and then show first frame */
-    s = gdk_mir_window_impl_ref_cairo_surface (window);
-    send_buffer (window);
-    cairo_surface_destroy (s);
-  }
+    {
+      /* Make sure something is rendered and then show first frame */
+      s = gdk_mir_window_impl_ref_cairo_surface (window);
+      send_buffer (window);
+      cairo_surface_destroy (s);
+    }
 }
 
 static void


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