[gtk+/wip/mir2] mir: add back window hierarchy functions



commit e13fc72af1f7ccad4f1fd7a3f4d077972627ad31
Author: William Hua <william attente ca>
Date:   Thu Jan 8 00:23:02 2015 -0500

    mir: add back window hierarchy functions

 gdk/mir/gdkmirwindowimpl.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 1245159..d4a4f2d 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -924,6 +924,49 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
     ensure_no_surface (window);
 }
 
+/* TODO: Remove once we have proper transient window support. */
+GdkWindow *
+_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
+                                             gdouble    x,
+                                             gdouble    y,
+                                             gdouble   *out_x,
+                                             gdouble   *out_y)
+{
+  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
+  GdkWindow *child = NULL;
+  GList *i;
+
+  x -= window->x;
+  y -= window->y;
+
+  if (x < 0 || x >= window->width || y < 0 || y >= window->height)
+    return NULL;
+
+  for (i = impl->transient_children; i && !child; i = i->next)
+    {
+      if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
+        child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y);
+    }
+
+  if (child)
+    return child;
+
+  *out_x = x;
+  *out_y = y;
+
+  return window;
+}
+
+/* TODO: Remove once we have proper transient window support. */
+void
+_gdk_mir_window_transient_children_foreach (GdkWindow  *window,
+                                            void      (*func) (GdkWindow *, gpointer),
+                                            gpointer    user_data)
+{
+  GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
+  g_list_foreach (impl->transient_children, (GFunc) func, user_data);
+}
+
 static void
 gdk_mir_window_impl_get_frame_extents (GdkWindow    *window,
                                        GdkRectangle *rect)


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