[PATCH 3/4] compositor: remove idle_inhibit optimization

Pekka Paalanen ppaalanen at gmail.com
Mon Nov 7 07:12:33 PST 2011


With the idle_inhibit optimization, wlsc_compositor_wake() is a no-op if
idle_inhibit > 0.

When the shell is waking up the compositor from SLEEPING state as an
indirect response to input activity, it does not work. The call path is:
notify_key() / notify_button()
	wlsc_compositor_idle_inhibit()
		wlsc_compositor_activity()
			shell->unlock()
				send prepare_lock_surface event
	idle_inhibit++

and when the desktop-shell client responds to the event:

desktop_shell_set_lock_surface() / desktop_shell_unlock()
	wlsc_compositor_wake()
		no-op, because idle_inhibit > 0

Then comes button or key release, idle_inhibit--, prepare_lock_surface
is sent again, desktop-shell replies again, and then
wlsc_compositor_wake() works.

Fix this by removing the idle_inhibit check from wlsc_compositor_wake().
The optimization did not work for pointer motion while no keys pressed,
anyway, so the performance hit is probably unobservable.

Now the compositor wakes up also on key or button press.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 compositor/compositor.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/compositor/compositor.c b/compositor/compositor.c
index fd72214..6d35586 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -1333,9 +1333,6 @@ static const struct wl_grab_interface implicit_grab_interface = {
 WL_EXPORT void
 wlsc_compositor_wake(struct wlsc_compositor *compositor)
 {
-	if (compositor->idle_inhibit)
-		return;
-
 	wlsc_compositor_fade(compositor, 0.0);
 	compositor->state = WLSC_COMPOSITOR_ACTIVE;
 
-- 
1.7.3.4



More information about the wayland-devel mailing list