mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-15 05:31:45 +00:00
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>
This commit is contained in:
parent
8771a14ff3
commit
7ef3bed03c
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue