mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Fall out of touch cursor function if mouse emulation is set, rather than editing capabilities
This commit is contained in:
parent
05b57d95fe
commit
36bd2884e7
2 changed files with 8 additions and 7 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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 =
|
|
||||||
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;
|
caps |= WL_SEAT_CAPABILITY_TOUCH;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue