[gtk+/gdk-backend-wayland] wayland: Map transient surfaces as such
- From: Kristian Høgsberg <krh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend-wayland] wayland: Map transient surfaces as such
- Date: Sat, 12 Feb 2011 13:40:30 +0000 (UTC)
commit b5134619a047cd208257ff0adc7d3aeb54bdd426
Author: Kristian Høgsberg <krh bitplanet net>
Date: Fri Feb 11 17:20:14 2011 -0500
wayland: Map transient surfaces as such
gdk/wayland/gdkwindow-wayland.c | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 0388037..2fbcab9 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -100,6 +100,7 @@ struct _GdkWindowImplWayland
struct wl_surface *surface;
unsigned int mapped : 1;
+ GdkWindow *transient_for;
cairo_surface_t *cairo_surface;
cairo_surface_t *server_surface;
@@ -448,6 +449,32 @@ gdk_wayland_window_set_user_time (GdkWindow *window, guint32 user_time)
}
static void
+gdk_wayland_window_map (GdkWindow *window)
+{
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkWindowImplWayland *parent;
+
+ if (!impl->mapped)
+ {
+ if (impl->transient_for)
+ {
+ fprintf(stderr, "parent surface: %d, %d, transient surface %d, %d\n",
+ impl->transient_for->x,
+ impl->transient_for->y,
+ window->x,
+ window->y);
+
+ parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
+ wl_surface_map_transient (impl->surface, parent->surface,
+ window->x, window->y, 0);
+ }
+ else
+ wl_surface_map_toplevel (impl->surface);
+ impl->mapped = TRUE;
+ }
+}
+
+static void
gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
{
GdkDisplay *display;
@@ -881,6 +908,10 @@ static void
gdk_wayland_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
+ GdkWindowImplWayland *impl;
+
+ impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ impl->transient_for = parent;
}
static void
@@ -1214,11 +1245,7 @@ gdk_wayland_window_process_updates_recurse (GdkWindow *window,
if (impl->cairo_surface)
gdk_wayland_window_attach_image (window);
- if (!impl->mapped)
- {
- wl_surface_map_toplevel (impl->surface);
- impl->mapped = TRUE;
- }
+ gdk_wayland_window_map (window);
n = cairo_region_num_rectangles(region);
for (i = 0; i < n; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]