summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiulio Camuffo <giuliocamuffo@gmail.com>2013-04-25 13:57:45 +0300
committerKristian Høgsberg <krh@bitplanet.net>2013-05-10 14:35:25 -0400
commit61da3fc94813a1282640594c599591b9cc70bdae (patch)
treebff3516b22bfb2251f2314b6e0f0965b5ee27170
parent01388e253ea1c1c7b4bb624815af717c102d1c48 (diff)
shell: enable moving and resizing of a surface when clicking on a subsurface
[pq: changed to weston_surface_get_main_surface(), and used a temporary variable to clean up the expressions.] Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
-rw-r--r--src/shell.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shell.c b/src/shell.c
index 846b835..55f3dcc 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1109,10 +1109,12 @@ shell_surface_move(struct wl_client *client, struct wl_resource *resource,
{
struct weston_seat *seat = seat_resource->data;
struct shell_surface *shsurf = resource->data;
+ struct weston_surface *surface;
+ surface = weston_surface_get_main_surface(seat->pointer->focus);
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
- seat->pointer->focus != shsurf->surface)
+ surface != shsurf->surface)
return;
if (surface_move(shsurf, seat) < 0)
@@ -1232,13 +1234,15 @@ shell_surface_resize(struct wl_client *client, struct wl_resource *resource,
{
struct weston_seat *seat = seat_resource->data;
struct shell_surface *shsurf = resource->data;
+ struct weston_surface *surface;
if (shsurf->type == SHELL_SURFACE_FULLSCREEN)
return;
+ surface = weston_surface_get_main_surface(seat->pointer->focus);
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
- seat->pointer->focus != shsurf->surface)
+ surface != shsurf->surface)
return;
if (surface_resize(shsurf, seat, edges) < 0)