summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-01-06 14:28:13 -0600
committerBryce Harrington <bryce@osg.samsung.com>2015-01-30 14:11:29 -0800
commit7ef3bed03cee03a746f739c30320a0599be1ea0c (patch)
tree9c6013eea4ef408c3cdad442f35b0ffeda07af96
parent8771a14ff38b7c568e3e3fe99fef8681f5792ad3 (diff)
downloadweston-7ef3bed03cee03a746f739c30320a0599be1ea0c.tar.gz
desktop-shell: Don't crash on zoom without a pointer in the seat
The zoom effect zooms at the seat's current pointer location. When no pointer is present the zoom key bindings cause a crash. Instead, check for the absence of a pointer and log a warning. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--desktop-shell/shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index f6d9c793..456763d1 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -4671,6 +4671,11 @@ do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
struct weston_output *output;
float increment;
+ if (!seat->pointer) {
+ weston_log("Zoom hotkey pressed but seat '%s' contains no pointer.\n", seat->seat_name);
+ return;
+ }
+
wl_list_for_each(output, &compositor->output_list, link) {
if (pixman_region32_contains_point(&output->region,
wl_fixed_to_double(seat->pointer->x),