[PATCH weston 05/68] compositor-drm: Remove open-coded weston_compositor_wake

Daniel Stone daniels at collabora.com
Fri Dec 9 19:57:20 UTC 2016


This always changes the state to ACTIVE when we enter the session,
whereas the previous implementation preserved the state (i.e. if state
was SLEEPING on exit, it would be restored to SLEEPING, but also with a
repaint). This seems more helpful behaviour, however: if you enter a
session, it's probably in order to interact with it.

Differential Revision: https://phabricator.freedesktop.org/D1482

Signed-off-by: Daniel Stone <daniels at collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 libweston/compositor-drm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 7d1c01b..d577c05 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -116,8 +116,6 @@ struct drm_backend {
 
 	int use_pixman;
 
-	uint32_t prev_state;
-
 	struct udev_input input;
 
 	int32_t cursor_width;
@@ -2833,14 +2831,13 @@ session_notify(struct wl_listener *listener, void *data)
 
 	if (compositor->session_active) {
 		weston_log("activating session\n");
-		compositor->state = b->prev_state;
+		weston_compositor_wake(compositor);
 		weston_compositor_damage_all(compositor);
 		udev_input_enable(&b->input);
 	} else {
 		weston_log("deactivating session\n");
 		udev_input_disable(&b->input);
 
-		b->prev_state = compositor->state;
 		weston_compositor_offscreen(compositor);
 
 		/* If we have a repaint scheduled (either from a
@@ -3197,8 +3194,6 @@ drm_backend_create(struct weston_compositor *compositor,
 	b->base.destroy = drm_destroy;
 	b->base.restore = drm_restore;
 
-	b->prev_state = WESTON_COMPOSITOR_ACTIVE;
-
 	weston_setup_vt_switch_bindings(compositor);
 
 	wl_list_init(&b->sprite_list);
-- 
2.9.3



More information about the wayland-devel mailing list