[PATCH] shell: Add missing break to a case statement inside set_surface_type.

Rafael Antognolli rafael.antognolli at intel.com
Wed Dec 4 12:31:28 PST 2013


This should fix the surface not going back to its original position
after unsetting fullscreen or maximized states.
---
 desktop-shell/shell.c | 3 +++
 src/compositor.c      | 1 +
 2 files changed, 4 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index de54e37..d270c27 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2213,6 +2213,7 @@ unset_fullscreen(struct shell_surface *shsurf)
 		weston_surface_destroy(shsurf->fullscreen.black_view->surface);
 	shsurf->fullscreen.black_view = NULL;
 
+	printf(">>> restored position: %d,%d\n", shsurf->saved_x, shsurf->saved_y);
 	weston_view_set_position(shsurf->view,
 				 shsurf->saved_x, shsurf->saved_y);
 	if (shsurf->saved_rotation_valid) {
@@ -2364,6 +2365,7 @@ set_full_output(struct shell_surface *shsurf)
 {
 	shsurf->saved_x = shsurf->view->geometry.x;
 	shsurf->saved_y = shsurf->view->geometry.y;
+	printf(">>> saved position: %d,%d\n", shsurf->saved_x, shsurf->saved_y);
 	shsurf->saved_width = shsurf->surface->width;
 	shsurf->saved_height = shsurf->surface->height;
 	shsurf->saved_size_valid = true;
@@ -2399,6 +2401,7 @@ set_surface_type(struct shell_surface *shsurf)
 						 pev->geometry.x + shsurf->transient.x,
 						 pev->geometry.y + shsurf->transient.y);
 		}
+		break;
 
 	case SHELL_SURFACE_XWAYLAND:
 		weston_view_set_position(shsurf->view, shsurf->transient.x,
diff --git a/src/compositor.c b/src/compositor.c
index 8f4bdef..7bb17a9 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1077,6 +1077,7 @@ weston_view_set_position(struct weston_view *view, float x, float y)
 
 	view->geometry.x = x;
 	view->geometry.y = y;
+	printf(">>> view set position: %0.3f,%0.3f\n", x, y);
 	weston_view_geometry_dirty(view);
 }
 
-- 
1.8.3.1



More information about the wayland-devel mailing list