diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-04-27 17:17:12 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-04-27 17:17:12 -0400 |
commit | 407ef64e17d8dc10677afcd815321c7b8ecea8b3 (patch) | |
tree | 24f156c639aa20ab9db2c5f603fad0b9c058e2ff | |
parent | 7bcb8bd30e4db4a54d2136c5864d737a8ebbfae9 (diff) |
window: Only set toplevel window type if nothing else is set
-rw-r--r-- | clients/window.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clients/window.c b/clients/window.c index ecb9bc3..2390485 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; } |