aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2020-05-02 19:09:58 -0400
committerSimon Ser <contact@emersion.fr>2020-05-13 08:58:23 +0200
commit2262ae60f4c405b881ca342a96f90865adc60ad0 (patch)
tree6778e0b475f39d9c19fa317495d4f688b27d06af /sway
parenta8a6ed667d0f9fe747a86bd8607f875e097e3af5 (diff)
downloadsway-2262ae60f4c405b881ca342a96f90865adc60ad0.tar.xz
input/cursor: don't apply pointer constraint to emulated tablet input
Closes #5268.
Diffstat (limited to 'sway')
-rw-r--r--sway/input/cursor.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index bb846e38..f3f056d1 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -292,16 +292,19 @@ void cursor_unhide(struct sway_cursor *cursor) {
static void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
struct wlr_input_device *device, double dx, double dy,
double dx_unaccel, double dy_unaccel) {
- cursor_handle_activity(cursor, IDLE_SOURCE_POINTER);
+ if (device->type == WLR_INPUT_DEVICE_POINTER) {
+ cursor_handle_activity(cursor, IDLE_SOURCE_POINTER);
+ }
wlr_relative_pointer_manager_v1_send_relative_motion(
server.relative_pointer_manager,
cursor->seat->wlr_seat, (uint64_t)time_msec * 1000,
dx, dy, dx_unaccel, dy_unaccel);
- struct wlr_surface *surface = NULL;
- double sx, sy;
- if (cursor->active_constraint) {
+ // Only apply pointer constraints to real pointer input.
+ if (cursor->active_constraint && device->type == WLR_INPUT_DEVICE_POINTER) {
+ struct wlr_surface *surface = NULL;
+ double sx, sy;
node_at_coords(cursor->seat,
cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy);