summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-07-15 13:00:40 -0500
committerBryce Harrington <bryce@osg.samsung.com>2015-07-16 19:04:17 -0700
commit8fbebbd985bf375e3b122d623a28f173bba34327 (patch)
tree9d6ea83e49f5e0dd091324d9dfe893f52a9e7bef /desktop-shell
parent74de4693b799b40e587feea715fa27f51873d2c0 (diff)
desktop-shell: Make surface_resize take a pointer instead of a seat
It doesn't actually need the seat and we have to validate that the seat has a pointer before making the call, so it's safer just to pass the validated pointer. Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index a215b9d8..6915d9c2 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1943,7 +1943,7 @@ surface_subsurfaces_boundingbox(struct weston_surface *surface, int32_t *x,
static int
surface_resize(struct shell_surface *shsurf,
- struct weston_seat *seat, uint32_t edges)
+ struct weston_pointer *pointer, uint32_t edges)
{
struct weston_resize_grab *resize;
const unsigned resize_topbottom =
@@ -1974,7 +1974,7 @@ surface_resize(struct shell_surface *shsurf,
shsurf->resize_edges = edges;
shell_surface_state_changed(shsurf);
shell_grab_start(&resize->base, &resize_grab_interface, shsurf,
- seat->pointer, edges);
+ pointer, edges);
return 0;
}
@@ -1998,7 +1998,7 @@ common_surface_resize(struct wl_resource *resource,
if (surface != shsurf->surface)
return;
- if (surface_resize(shsurf, seat, edges) < 0)
+ if (surface_resize(shsurf, seat->pointer, edges) < 0)
wl_resource_post_no_memory(resource);
}
@@ -3063,6 +3063,14 @@ shell_interface_move(struct shell_surface *shsurf, struct weston_seat *ws)
return surface_move(shsurf, ws->pointer, true);
}
+static int
+shell_interface_resize(struct shell_surface *shsurf,
+ struct weston_seat *ws,
+ uint32_t edges)
+{
+ return surface_resize(shsurf, ws->pointer, edges);
+}
+
static const struct weston_pointer_grab_interface popup_grab_interface;
static void
@@ -4728,7 +4736,7 @@ resize_binding(struct weston_pointer *pointer, uint32_t time,
else
edges |= WL_SHELL_SURFACE_RESIZE_BOTTOM;
- surface_resize(shsurf, pointer->seat, edges);
+ surface_resize(shsurf, pointer, edges);
}
static void
@@ -6526,7 +6534,7 @@ module_init(struct weston_compositor *ec,
ec->shell_interface.set_fullscreen = shell_interface_set_fullscreen;
ec->shell_interface.set_xwayland = set_xwayland;
ec->shell_interface.move = shell_interface_move;
- ec->shell_interface.resize = surface_resize;
+ ec->shell_interface.resize = shell_interface_resize;
ec->shell_interface.set_title = set_title;
ec->shell_interface.set_window_geometry = set_window_geometry;
ec->shell_interface.set_maximized = shell_interface_set_maximized;