From a4575634f4a1f63430cfc4da5b7ab757f6c33c1c Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Thu, 21 Feb 2013 18:35:23 +0200 Subject: [PATCH] compositor: Rename lock and unlock signals to idle and wake After the changes introduced in the previous patch, those names are more appropriate. It is up to the shell to decide when to lock the screen. --- src/animation.c | 2 +- src/compositor.c | 8 ++++---- src/compositor.h | 4 ++-- src/shell.c | 24 ++++++++++++------------ src/tablet-shell.c | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/animation.c b/src/animation.c index 5b6db316..9e2ad4ec 100644 --- a/src/animation.c +++ b/src/animation.c @@ -154,7 +154,7 @@ weston_surface_animation_frame(struct weston_animation *base, animation->frame(animation); animation->surface->geometry.dirty = 1; - weston_surface_schedule_repaint(animation->surface); + weston_compositor_schedule_repaint(animation->surface->compositor); } static struct weston_surface_animation * diff --git a/src/compositor.c b/src/compositor.c index eb453d04..5ff68d7a 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1592,7 +1592,7 @@ weston_compositor_wake(struct weston_compositor *compositor) weston_compositor_dpms(compositor, WESTON_DPMS_ON); /* fall through */ case WESTON_COMPOSITOR_IDLE: - wl_signal_emit(&compositor->unlock_signal, compositor); + wl_signal_emit(&compositor->wake_signal, compositor); /* fall through */ default: compositor->state = WESTON_COMPOSITOR_ACTIVE; @@ -1634,7 +1634,7 @@ idle_handler(void *data) return 1; compositor->state = WESTON_COMPOSITOR_IDLE; - wl_signal_emit(&compositor->lock_signal, compositor); + wl_signal_emit(&compositor->idle_signal, compositor); return 1; } @@ -3012,8 +3012,8 @@ weston_compositor_init(struct weston_compositor *ec, wl_signal_init(&ec->destroy_signal); wl_signal_init(&ec->activate_signal); wl_signal_init(&ec->kill_signal); - wl_signal_init(&ec->lock_signal); - wl_signal_init(&ec->unlock_signal); + wl_signal_init(&ec->idle_signal); + wl_signal_init(&ec->wake_signal); wl_signal_init(&ec->show_input_panel_signal); wl_signal_init(&ec->hide_input_panel_signal); wl_signal_init(&ec->seat_created_signal); diff --git a/src/compositor.h b/src/compositor.h index fdee03cb..676e0d9b 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -296,8 +296,8 @@ struct weston_compositor { struct wl_signal activate_signal; struct wl_signal kill_signal; - struct wl_signal lock_signal; - struct wl_signal unlock_signal; + struct wl_signal idle_signal; + struct wl_signal wake_signal; struct wl_signal show_input_panel_signal; struct wl_signal hide_input_panel_signal; diff --git a/src/shell.c b/src/shell.c index 8175f9af..ed6f434a 100644 --- a/src/shell.c +++ b/src/shell.c @@ -83,8 +83,8 @@ struct input_panel_surface { struct desktop_shell { struct weston_compositor *compositor; - struct wl_listener lock_listener; - struct wl_listener unlock_listener; + struct wl_listener idle_listener; + struct wl_listener wake_listener; struct wl_listener destroy_listener; struct wl_listener show_input_panel_listener; struct wl_listener hide_input_panel_listener; @@ -2894,20 +2894,20 @@ shell_fade(struct desktop_shell *shell, enum fade_type type) } static void -lock_handler(struct wl_listener *listener, void *data) +idle_handler(struct wl_listener *listener, void *data) { struct desktop_shell *shell = - container_of(listener, struct desktop_shell, lock_listener); + container_of(listener, struct desktop_shell, idle_listener); shell_fade(shell, FADE_OUT); /* lock() is called from shell_fade_done() */ } static void -unlock_handler(struct wl_listener *listener, void *data) +wake_handler(struct wl_listener *listener, void *data) { struct desktop_shell *shell = - container_of(listener, struct desktop_shell, unlock_listener); + container_of(listener, struct desktop_shell, wake_listener); unlock(shell); } @@ -3965,8 +3965,8 @@ shell_destroy(struct wl_listener *listener, void *data) if (shell->child.client) wl_client_destroy(shell->child.client); - wl_list_remove(&shell->lock_listener.link); - wl_list_remove(&shell->unlock_listener.link); + wl_list_remove(&shell->idle_listener.link); + wl_list_remove(&shell->wake_listener.link); wl_list_remove(&shell->show_input_panel_listener.link); wl_list_remove(&shell->hide_input_panel_listener.link); @@ -4070,10 +4070,10 @@ module_init(struct weston_compositor *ec, shell->destroy_listener.notify = shell_destroy; wl_signal_add(&ec->destroy_signal, &shell->destroy_listener); - shell->lock_listener.notify = lock_handler; - wl_signal_add(&ec->lock_signal, &shell->lock_listener); - shell->unlock_listener.notify = unlock_handler; - wl_signal_add(&ec->unlock_signal, &shell->unlock_listener); + shell->idle_listener.notify = idle_handler; + wl_signal_add(&ec->idle_signal, &shell->idle_listener); + shell->wake_listener.notify = wake_handler; + wl_signal_add(&ec->wake_signal, &shell->wake_listener); shell->show_input_panel_listener.notify = show_input_panels; wl_signal_add(&ec->show_input_panel_signal, &shell->show_input_panel_listener); shell->hide_input_panel_listener.notify = hide_input_panels; diff --git a/src/tablet-shell.c b/src/tablet-shell.c index 57226e87..9006b195 100644 --- a/src/tablet-shell.c +++ b/src/tablet-shell.c @@ -547,9 +547,9 @@ module_init(struct weston_compositor *compositor, shell->destroy_listener.notify = tablet_shell_destroy; wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); shell->lock_listener.notify = tablet_shell_lock; - wl_signal_add(&compositor->lock_signal, &shell->lock_listener); + wl_signal_add(&compositor->idle_signal, &shell->lock_listener); shell->unlock_listener.notify = tablet_shell_unlock; - wl_signal_add(&compositor->unlock_signal, &shell->unlock_listener); + wl_signal_add(&compositor->wake_signal, &shell->unlock_listener); /* FIXME: This will make the object available to all clients. */ wl_display_add_global(compositor->wl_display, &tablet_shell_interface,