Libinput returns -1 when calling libinput_event_touch_get_slot on an event
from a single-touch touchscreen. The returned value is used in
DecorationEventFilter to determine the touch which is acting on it. The value -1
is used to signify that the decoration is not being acted on. Thus when
releasing the touch, it checks whether it was being dragged, and as it thinks
it isn't, it doesn't handle it and the decoration is still being dragged.
Clicking on the decoration then crashes kwin.
Details
Details
- Reviewers
graesslin - Group Reviewers
KWin - Commits
- R108:0eba3f3c18c2: Fix TouchEvent::id() returning -1, fixes a crash
Move a window by dragging the decoration with a single-touch touchscreen.
Diff Detail
Diff Detail
- Repository
- R108 KWin
- Branch
- jessep/fix-single-touch-slot
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
If you want you could add another testcase in autotests/libinput/touch_event_test.cpp to cover the special condition.
Otherwise looks good and is quite straight forward. Thanks for this fix.
libinput/events.cpp | ||
---|---|---|
229 | I suggest to const this. |