mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-05 04:06:11 -05:00
wlr_virtual_pointer: Set axis source on all axis
Currently it is possible to crash a wlroots compositor by setting any
axis source other than 0 and sending an axis event in the HORIZONTAL
direction from wlr_virtual_pointer since the axis source is only set on
the first axis.
This then hits the assert in wlr_seat_pointer.c:332.
Fix by always setting the source on all axis.
(cherry picked from commit aef84f0e4d)
This commit is contained in:
parent
8c9e6b7c9f
commit
878aebfb74
1 changed files with 5 additions and 2 deletions
|
|
@ -134,8 +134,11 @@ static void virtual_pointer_axis_source(struct wl_client *client,
|
|||
if (pointer == NULL) {
|
||||
return;
|
||||
}
|
||||
pointer->axis_event[pointer->axis].pointer = &pointer->pointer;
|
||||
pointer->axis_event[pointer->axis].source = source;
|
||||
int n_axis = sizeof(pointer->axis_event) / sizeof(pointer->axis_event[0]);
|
||||
for (int i = 0; i < n_axis; i++) {
|
||||
pointer->axis_event[i].pointer = &pointer->pointer;
|
||||
pointer->axis_event[i].source = source;
|
||||
}
|
||||
}
|
||||
|
||||
static void virtual_pointer_axis_stop(struct wl_client *client,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue