From 407ef64e17d8dc10677afcd815321c7b8ecea8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 27 Apr 2012 17:17:12 -0400 Subject: [PATCH] window: Only set toplevel window type if nothing else is set --- clients/window.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/clients/window.c b/clients/window.c index ecb9bc37..2390485c 100644 --- a/clients/window.c +++ b/clients/window.c @@ -103,6 +103,7 @@ struct display { }; enum { + TYPE_NONE, TYPE_TOPLEVEL, TYPE_FULLSCREEN, TYPE_MAXIMIZED, @@ -603,6 +604,12 @@ window_attach_surface(struct window *window) #endif int32_t x, y; + if (window->type == TYPE_NONE) { + window->type = TYPE_TOPLEVEL; + if (display->shell) + wl_shell_surface_set_toplevel(window->shell_surface); + } + switch (window->buffer_type) { #ifdef HAVE_CAIRO_EGL case WINDOW_BUFFER_TYPE_EGL_WINDOW: @@ -2218,7 +2225,7 @@ window_create_internal(struct display *display, struct window *parent) window->allocation.height = 0; window->saved_allocation = window->allocation; window->transparent = 1; - window->type = TYPE_TOPLEVEL; + window->type = TYPE_NONE; window->input_region = NULL; window->opaque_region = NULL; @@ -2253,10 +2260,6 @@ window_create(struct display *display) if (!window) return NULL; - window->type = TYPE_TOPLEVEL; - if (display->shell) - wl_shell_surface_set_toplevel(window->shell_surface); - return window; }