[PATCH 1/2 v4] shell: enable moving and resizing of a surface when clicking on a subsurface

Giulio Camuffo giuliocamuffo at gmail.com
Tue Feb 26 06:59:57 PST 2013


---
 src/shell.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/shell.c b/src/shell.c
index c8f20ec..da41efa 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1092,10 +1092,12 @@ shell_surface_move(struct wl_client *client, struct wl_resource *resource,
 {
 	struct weston_seat *ws = seat_resource->data;
 	struct shell_surface *shsurf = resource->data;
+	struct weston_surface *surface = weston_surface_get_parent(
+		container_of(ws->seat.pointer->focus, struct weston_surface, surface));
 
 	if (ws->seat.pointer->button_count == 0 ||
 	    ws->seat.pointer->grab_serial != serial ||
-	    ws->seat.pointer->focus != &shsurf->surface->surface)
+	    surface != shsurf->surface)
 		return;
 
 	if (surface_move(shsurf, ws) < 0)
@@ -1215,13 +1217,15 @@ shell_surface_resize(struct wl_client *client, struct wl_resource *resource,
 {
 	struct weston_seat *ws = seat_resource->data;
 	struct shell_surface *shsurf = resource->data;
+	struct weston_surface *surface = weston_surface_get_parent(
+		container_of(ws->seat.pointer->focus, struct weston_surface, surface));
 
 	if (shsurf->type == SHELL_SURFACE_FULLSCREEN)
 		return;
 
 	if (ws->seat.pointer->button_count == 0 ||
 	    ws->seat.pointer->grab_serial != serial ||
-	    ws->seat.pointer->focus != &shsurf->surface->surface)
+	    surface != shsurf->surface)
 		return;
 
 	if (surface_resize(shsurf, ws, edges) < 0)
-- 
1.8.1.3



More information about the wayland-devel mailing list