Commit b5134619 authored by Kristian Høgsberg's avatar Kristian Høgsberg

wayland: Map transient surfaces as such

parent 1cd65aea
......@@ -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;
......@@ -447,6 +448,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)
{
......@@ -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++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment