Move map requests to shell

This commit is contained in:
Kristian Høgsberg
2011-06-18 06:12:54 -04:00
parent 83eeacb489
commit 7a5c979f4c
4 changed files with 91 additions and 114 deletions
+4 -1
View File
@@ -37,6 +37,7 @@ struct display {
struct wl_display *display;
struct wl_visual *premultiplied_argb_visual;
struct wl_compositor *compositor;
struct wl_shell *shell;
struct {
EGLDisplay dpy;
EGLContext ctx;
@@ -227,7 +228,7 @@ create_surface(struct window *window)
window->native,
NULL);
wl_surface_map_toplevel(window->surface);
wl_shell_set_toplevel(display->shell, window->surface);
ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
window->egl_surface, window->display->egl.ctx);
@@ -320,6 +321,8 @@ display_handle_global(struct wl_display *display, uint32_t id,
d->compositor = wl_compositor_create(display, id, 1);
wl_compositor_add_listener(d->compositor,
&compositor_listener, d);
} else if (strcmp(interface, "wl_shell") == 0) {
d->shell = wl_shell_create(display, id, 1);
}
}
+5 -5
View File
@@ -733,13 +733,13 @@ window_attach_surface(struct window *window)
}
if (window->fullscreen)
wl_surface_map_fullscreen(window->surface);
wl_shell_set_fullscreen(display->shell, window->surface);
else if (!window->parent)
wl_surface_map_toplevel(window->surface);
wl_shell_set_toplevel(display->shell, window->surface);
else
wl_surface_map_transient(window->surface,
window->parent->surface,
window->x, window->y, 0);
wl_shell_set_transient(display->shell, window->surface,
window->parent->surface,
window->x, window->y, 0);
wl_surface_damage(window->surface, 0, 0,
window->allocation.width,