[PATCH 3/4] compositor: rename wlsc_shell::lock() to go_sleep()

Pekka Paalanen ppaalanen at gmail.com
Thu Nov 3 05:11:34 PDT 2011


The name 'go_sleep' better describes when the function is called: the
compositor has hit the idle timeout, faded to black, and entered
WLSC_COMPOSITOR_SLEEPING state.

In the desktop-shell case, the compositor will not be immediately
locked, as the name 'lock' might suggest.

In meego-tablet-shell, the shell goes into locked state as a response to
the compositor going to sleep.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 compositor/compositor.c         |    2 +-
 compositor/compositor.h         |    2 +-
 compositor/meego-tablet-shell.c |    2 +-
 compositor/shell.c              |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/compositor/compositor.c b/compositor/compositor.c
index 53b282a..d2b358e 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -785,7 +785,7 @@ fade_frame(struct wlsc_animation *animation,
 	if (wlsc_spring_done(&compositor->fade.spring)) {
 		if (compositor->fade.spring.current > 0.999) {
 			compositor->state = WLSC_COMPOSITOR_SLEEPING;
-			compositor->shell->lock(compositor->shell);
+			compositor->shell->go_sleep(compositor->shell);
 		}
 		compositor->fade.spring.current =
 			compositor->fade.spring.target;
diff --git a/compositor/compositor.h b/compositor/compositor.h
index 421b80e..29ca388 100644
--- a/compositor/compositor.h
+++ b/compositor/compositor.h
@@ -162,7 +162,7 @@ struct wlsc_shell {
 	void (*activate)(struct wlsc_shell *shell,
 			 struct wlsc_surface *es,
 			 struct wlsc_input_device *device, uint32_t time);
-	void (*lock)(struct wlsc_shell *shell);
+	void (*go_sleep)(struct wlsc_shell *shell);
 	void (*attach)(struct wlsc_shell *shell, struct wlsc_surface *surface);
 	void (*set_selection_focus)(struct wlsc_shell *shell,
 				    struct wl_selection *selection,
diff --git a/compositor/meego-tablet-shell.c b/compositor/meego-tablet-shell.c
index 35b9775..5ebf336 100644
--- a/compositor/meego-tablet-shell.c
+++ b/compositor/meego-tablet-shell.c
@@ -678,7 +678,7 @@ shell_init(struct wlsc_compositor *compositor)
 
 	compositor->shell = &shell->shell;
 
-	shell->shell.lock = meego_tablet_shell_lock;
+	shell->shell.go_sleep = meego_tablet_shell_lock;
 	shell->shell.attach = meego_tablet_shell_attach;
 	shell->shell.set_selection_focus =
 		meego_tablet_shell_set_selection_focus;
diff --git a/compositor/shell.c b/compositor/shell.c
index ed2637d..2e288d9 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -914,7 +914,7 @@ activate(struct wlsc_shell *base, struct wlsc_surface *es,
 }
 
 static void
-lock(struct wlsc_shell *shell)
+go_sleep(struct wlsc_shell *shell)
 {
 }
 
@@ -1031,7 +1031,7 @@ shell_init(struct wlsc_compositor *ec)
 	memset(shell, 0, sizeof *shell);
 	shell->compositor = ec;
 	shell->shell.activate = activate;
-	shell->shell.lock = lock;
+	shell->shell.go_sleep = go_sleep;
 	shell->shell.attach = attach;
 	shell->shell.set_selection_focus = wlsc_selection_set_focus;
 
-- 
1.7.3.4



More information about the wayland-devel mailing list