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

Kristian Høgsberg 13 years ago
parent 7bcb8bd30e
commit 407ef64e17
  1. 13
      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;
}

Loading…
Cancel
Save