compositor: Hide surfaces by setting surface->output to NULL

This way we can still use surface->link when a surface is not in
the main compositor surface list and don't need the hidden_surface
wrapper object.  Also, setting surface->output to NULL will block
the surface frame callback until we put the surface back into the
main list.  This has the effect of blocking animations while a surface
isn't visible.
This commit is contained in:
Kristian Høgsberg
2011-11-15 16:39:55 -05:00
parent bfbb26bdb2
commit 1ec0c31596
3 changed files with 58 additions and 106 deletions
+6 -6
View File
@@ -398,8 +398,9 @@ unlock_dialog_item_focus_handler(struct window *window,
}
static struct unlock_dialog *
unlock_dialog_create(struct display *display)
unlock_dialog_create(struct desktop *desktop)
{
struct display *display = desktop->display;
struct unlock_dialog *dialog;
dialog = malloc(sizeof *dialog);
@@ -419,6 +420,9 @@ unlock_dialog_create(struct display *display)
unlock_dialog_item_focus_handler);
dialog->button = window_add_item(dialog->window, NULL);
desktop_shell_set_lock_surface(desktop->shell,
window_get_wl_surface(dialog->window));
unlock_dialog_draw(dialog);
return dialog;
@@ -467,13 +471,9 @@ desktop_shell_prepare_lock_surface(void *data,
struct desktop *desktop = data;
if (!desktop->unlock_dialog) {
desktop->unlock_dialog =
unlock_dialog_create(desktop->display);
desktop->unlock_dialog = unlock_dialog_create(desktop);
desktop->unlock_dialog->desktop = desktop;
}
desktop_shell_set_lock_surface(desktop_shell,
window_get_wl_surface(desktop->unlock_dialog->window));
}
static const struct desktop_shell_listener listener = {