Fall out of touch cursor function if mouse emulation is set, rather than editing capabilities

This commit is contained in:
Simon Long 2024-10-20 12:58:59 +01:00
parent 05b57d95fe
commit 36bd2884e7
2 changed files with 8 additions and 7 deletions

View file

@ -24,6 +24,13 @@ static struct wlr_surface*
touch_get_coords(struct seat *seat, struct wlr_touch *touch, double x, double y, touch_get_coords(struct seat *seat, struct wlr_touch *touch, double x, double y,
double *x_offset, double *y_offset) double *x_offset, double *y_offset)
{ {
/* Fall out if mouse emulation is set */
struct touch_config_entry *config_entry =
touch_find_config_for_device(touch->base.name);
if (config_entry->force_mouse_emulation) {
return NULL;
}
/* Convert coordinates: first [0, 1] => layout, then layout => surface */ /* Convert coordinates: first [0, 1] => layout, then layout => surface */
double lx, ly; double lx, ly;
wlr_cursor_absolute_to_layout_coords(seat->cursor, &touch->base, wlr_cursor_absolute_to_layout_coords(seat->cursor, &touch->base,

View file

@ -411,13 +411,7 @@ seat_update_capabilities(struct seat *seat)
caps |= WL_SEAT_CAPABILITY_POINTER; caps |= WL_SEAT_CAPABILITY_POINTER;
break; break;
case WLR_INPUT_DEVICE_TOUCH: case WLR_INPUT_DEVICE_TOUCH:
config_entry = caps |= WL_SEAT_CAPABILITY_TOUCH;
touch_find_config_for_device(input->wlr_input_device->name);
if (config_entry->force_mouse_emulation) {
caps |= WL_SEAT_CAPABILITY_POINTER;
} else {
caps |= WL_SEAT_CAPABILITY_TOUCH;
}
break; break;
default: default:
break; break;