From: Giulio Camuffo <[email protected]> [pq: changed to weston_surface_get_main_surface(), and used a temporary variable to clean up the expressions.]
Signed-off-by: Pekka Paalanen <[email protected]> --- src/shell.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/shell.c b/src/shell.c index 99949b7..86bdd84 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1108,10 +1108,16 @@ 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 *focus; + struct weston_surface *surface; + + focus = container_of(ws->seat.pointer->focus, + struct weston_surface, surface); + surface = weston_surface_get_main_surface(focus); 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) @@ -1232,13 +1238,19 @@ 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 *focus; + struct weston_surface *surface; + + focus = container_of(ws->seat.pointer->focus, + struct weston_surface, surface); + surface = weston_surface_get_main_surface(focus); 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.5 _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
