summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2014-04-30 16:05:49 -0700
committerKristian Høgsberg <krh@bitplanet.net>2014-04-30 16:05:49 -0700
commita4b620e7e76f966586f4165b811a0c33de0214ac (patch)
treeaa00ef5c1f9de0523d3f30d8a569a7386ad4bef7 /desktop-shell
parente0b9d5be84be1e1e5d44a2c449fceb24d649e5e9 (diff)
desktop-shell: Further consolidate move/resize grab checks
This moves the check for shsurf->grabbed into surface_move() and surface_resize(), which are shared with the xwayland code. This prevents trying to resize or move an xwayland window with multiple pointers.
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 8d169aa9..a9c67fa6 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1556,7 +1556,8 @@ surface_move(struct shell_surface *shsurf, struct weston_seat *seat,
if (!shsurf)
return -1;
- if (shsurf->state.fullscreen || shsurf->state.maximized)
+ if (shsurf->grabbed ||
+ shsurf->state.fullscreen || shsurf->state.maximized)
return 0;
move = malloc(sizeof *move);
@@ -1583,9 +1584,6 @@ common_surface_move(struct wl_resource *resource,
struct shell_surface *shsurf = wl_resource_get_user_data(resource);
struct weston_surface *surface;
- if (shsurf->grabbed)
- return;
-
if (seat->pointer &&
seat->pointer->focus &&
seat->pointer->button_count > 0 &&
@@ -1746,7 +1744,8 @@ surface_resize(struct shell_surface *shsurf,
{
struct weston_resize_grab *resize;
- if (shsurf->state.fullscreen || shsurf->state.maximized)
+ if (shsurf->grabbed ||
+ shsurf->state.fullscreen || shsurf->state.maximized)
return 0;
if (edges == 0 || edges > 15 ||
@@ -1777,12 +1776,6 @@ common_surface_resize(struct wl_resource *resource,
struct shell_surface *shsurf = wl_resource_get_user_data(resource);
struct weston_surface *surface;
- if (shsurf->state.fullscreen)
- return;
-
- if (shsurf->grabbed)
- return;
-
if (seat->pointer->button_count == 0 ||
seat->pointer->grab_serial != serial ||
seat->pointer->focus == NULL)