window: Only set toplevel window type if nothing else is set

dev
Kristian Høgsberg 13 years ago
parent 7bcb8bd30e
commit 407ef64e17
  1. 13
      clients/window.c

@ -103,6 +103,7 @@ struct display {
}; };
enum { enum {
TYPE_NONE,
TYPE_TOPLEVEL, TYPE_TOPLEVEL,
TYPE_FULLSCREEN, TYPE_FULLSCREEN,
TYPE_MAXIMIZED, TYPE_MAXIMIZED,
@ -603,6 +604,12 @@ window_attach_surface(struct window *window)
#endif #endif
int32_t x, y; 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) { switch (window->buffer_type) {
#ifdef HAVE_CAIRO_EGL #ifdef HAVE_CAIRO_EGL
case WINDOW_BUFFER_TYPE_EGL_WINDOW: case WINDOW_BUFFER_TYPE_EGL_WINDOW:
@ -2218,7 +2225,7 @@ window_create_internal(struct display *display, struct window *parent)
window->allocation.height = 0; window->allocation.height = 0;
window->saved_allocation = window->allocation; window->saved_allocation = window->allocation;
window->transparent = 1; window->transparent = 1;
window->type = TYPE_TOPLEVEL; window->type = TYPE_NONE;
window->input_region = NULL; window->input_region = NULL;
window->opaque_region = NULL; window->opaque_region = NULL;
@ -2253,10 +2260,6 @@ window_create(struct display *display)
if (!window) if (!window)
return NULL; return NULL;
window->type = TYPE_TOPLEVEL;
if (display->shell)
wl_shell_surface_set_toplevel(window->shell_surface);
return window; return window;
} }

Loading…
Cancel
Save