[gtk+] mir: don't always request mir surfaces



commit 85c5f6058a01805d63a498b5f28d6a9daab3f7e1
Author: William Hua <william attente ca>
Date:   Tue Feb 3 16:23:14 2015 +0100

    mir: don't always request mir surfaces
    
    Some child window behaviour is faked by painting in the parent, so we
    don't bother creating the Mir surface in that case.

 gdk/mir/gdkmirwindowimpl.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 5ecec56..80b6e56 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -199,6 +199,15 @@ create_mir_surface (GdkDisplay *display,
   return surface;
 }
 
+/* TODO: Remove once we have proper transient window support. */
+static gboolean
+should_render_in_parent (GdkWindow *window)
+{
+  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
+
+  return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
+}
+
 static void
 ensure_surface_full (GdkWindow *window,
                      MirBufferUsage buffer_usage)
@@ -207,7 +216,7 @@ ensure_surface_full (GdkWindow *window,
   MirEventDelegate event_delegate = { event_cb, NULL };
   GdkMirWindowReference *window_ref;
 
-  if (impl->surface)
+  if (impl->surface || should_render_in_parent (window))
     return;
 
   /* no destroy notify -- we must leak for now
@@ -289,15 +298,6 @@ redraw_transient (GdkWindow *window)
   gdk_window_invalidate_rect (GDK_MIR_WINDOW_IMPL (window->impl)->transient_for, &r, FALSE);
 }
 
-/* TODO: Remove once we have proper transient window support. */
-static gboolean
-should_render_in_parent (GdkWindow *window)
-{
-  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
-
-  return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL;
-}
-
 static void
 send_buffer (GdkWindow *window)
 {


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