[PATCH 1/3] shell: fix lock surface mapping

Pekka Paalanen ppaalanen at gmail.com
Wed Nov 16 03:47:33 PST 2011


When the lock surface was map()'d while the compositor was locked,
wlsc_surface_configure() was never called for the lock surface. Hence,
the surface->output was NULL, and the 'frame' event was never sent,
causing desktop-shell to loop in dri2_swap_buffers().

Fix this by calling wlsc_surface_configure() for the lock surface
always in map().

Additionally, adjust the comments in map() to make it more readable.

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

diff --git a/compositor/shell.c b/compositor/shell.c
index 200b548..822c8c9 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -1069,17 +1069,23 @@ map(struct wlsc_shell *base,
 	else
 		list = &compositor->surface_list;
 
-	/* Map background at the bottom of the stack, panel on top,
-	   everything else just below panel. */
+	/* surface stacking order, see also activate() */
 	if (surface == shell->background) {
+		/* background always visible, at the bottom */
 		wl_list_insert(compositor->surface_list.prev, &surface->link);
+
 	} else if (surface == shell->panel) {
+		/* panel always on top, hidden while locked */
 		wl_list_insert(list, &surface->link);
+
 	} else if (surface == shell->lock_surface) {
+		/* lock surface always visible, on top */
 		wl_list_insert(&compositor->surface_list, &surface->link);
+
 		wlsc_compositor_repick(compositor);
 		wlsc_compositor_wake(compositor);		
 	} else {
+		/* everything else just below the panel */
 		wl_list_insert(&shell->panel->link, &surface->link);
 	}
 
@@ -1090,7 +1096,7 @@ map(struct wlsc_shell *base,
 
 	surface->width = width;
 	surface->height = height;
-	if (!shell->locked)
+	if (!shell->locked || surface == shell->lock_surface)
 		wlsc_surface_configure(surface,
 				       surface->x, surface->y, width, height);
 }
-- 
1.7.3.4



More information about the wayland-devel mailing list