mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Only generate touch events on valid surfaces
This commit is contained in:
parent
1e437ef752
commit
eb19d10d6d
1 changed files with 8 additions and 6 deletions
|
|
@ -61,9 +61,10 @@ touch_motion(struct wl_listener *listener, void *data)
|
||||||
double sx = lx - touch_point->x_offset;
|
double sx = lx - touch_point->x_offset;
|
||||||
double sy = ly - touch_point->y_offset;
|
double sy = ly - touch_point->y_offset;
|
||||||
|
|
||||||
wlr_seat_touch_notify_motion(seat->seat, event->time_msec,
|
if (touch_point->surface) {
|
||||||
event->touch_id, sx, sy);
|
wlr_seat_touch_notify_motion(seat->seat, event->time_msec,
|
||||||
if (!touch_point->surface) {
|
event->touch_id, sx, sy);
|
||||||
|
} else {
|
||||||
cursor_emulate_move_absolute(seat, &event->touch->base,
|
cursor_emulate_move_absolute(seat, &event->touch->base,
|
||||||
event->x, event->y, event->time_msec);
|
event->x, event->y, event->time_msec);
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +127,10 @@ touch_up(struct wl_listener *listener, void *data)
|
||||||
struct touch_point *touch_point, *tmp;
|
struct touch_point *touch_point, *tmp;
|
||||||
wl_list_for_each_safe(touch_point, tmp, &seat->touch_points, link) {
|
wl_list_for_each_safe(touch_point, tmp, &seat->touch_points, link) {
|
||||||
if (touch_point->touch_id == event->touch_id) {
|
if (touch_point->touch_id == event->touch_id) {
|
||||||
if (!touch_point->surface) {
|
if (touch_point->surface) {
|
||||||
|
wlr_seat_touch_notify_up(seat->seat, event->time_msec,
|
||||||
|
event->touch_id);
|
||||||
|
} else {
|
||||||
cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_RELEASED,
|
cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_RELEASED,
|
||||||
event->time_msec);
|
event->time_msec);
|
||||||
}
|
}
|
||||||
|
|
@ -135,8 +139,6 @@ touch_up(struct wl_listener *listener, void *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_seat_touch_notify_up(seat->seat, event->time_msec, event->touch_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue