seat: be explicit about output- and layout coordinates

This commit follows up on 95b7782c72
This commit is contained in:
Jente Hidskes 2020-01-05 13:13:32 +01:00
parent 530b32d496
commit 651d579c30
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA
3 changed files with 16 additions and 16 deletions

View file

@ -179,8 +179,8 @@ drag_icons_for_each_surface(struct cg_server *server, wlr_surface_iterator_func_
if (!drag_icon->wlr_drag_icon->mapped) {
continue;
}
rdata->ox = drag_icon->x;
rdata->oy = drag_icon->y;
rdata->ox = drag_icon->lx;
rdata->oy = drag_icon->ly;
wlr_output_layout_output_coords(server->output_layout, wlr_output, &rdata->ox, &rdata->oy);
wlr_surface_for_each_surface(drag_icon->wlr_drag_icon->surface,
iterator,
@ -434,8 +434,8 @@ output_damage_drag_icon(struct cg_output *output, struct cg_drag_icon *drag_icon
{
struct damage_data data = {
.output = output,
.ox = drag_icon->x,
.oy = drag_icon->y,
.ox = drag_icon->lx,
.oy = drag_icon->ly,
.whole = true,
};
wlr_output_layout_output_coords(output->server->output_layout, output->wlr_output, &data.ox, &data.oy);

18
seat.c
View file

@ -428,8 +428,8 @@ handle_touch_down(struct wl_listener *listener, void *data)
if (serial && wlr_seat_touch_num_points(seat->seat) == 1) {
seat->touch_id = event->touch_id;
seat->touch_x = lx;
seat->touch_y = ly;
seat->touch_lx = lx;
seat->touch_ly = ly;
press_cursor_button(seat, event->device, event->time_msec,
BTN_LEFT, WLR_BUTTON_PRESSED, lx, ly);
}
@ -450,7 +450,7 @@ handle_touch_up(struct wl_listener *listener, void *data)
if (wlr_seat_touch_num_points(seat->seat) == 1) {
press_cursor_button(seat, event->device, event->time_msec,
BTN_LEFT, WLR_BUTTON_RELEASED,
seat->touch_x, seat->touch_y);
seat->touch_lx, seat->touch_ly);
}
wlr_seat_touch_notify_up(seat->seat, event->time_msec, event->touch_id);
@ -487,8 +487,8 @@ handle_touch_motion(struct wl_listener *listener, void *data)
}
if (event->touch_id == seat->touch_id) {
seat->touch_x = lx;
seat->touch_y = ly;
seat->touch_lx = lx;
seat->touch_ly = ly;
}
wlr_idle_notify_activity(seat->server->idle, seat->seat);
@ -603,16 +603,16 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon)
case WLR_DRAG_GRAB_KEYBOARD:
return;
case WLR_DRAG_GRAB_KEYBOARD_POINTER:
drag_icon->x = seat->cursor->x;
drag_icon->y = seat->cursor->y;
drag_icon->lx = seat->cursor->x;
drag_icon->ly = seat->cursor->y;
break;
case WLR_DRAG_GRAB_KEYBOARD_TOUCH:
point = wlr_seat_touch_get_point(seat->seat, wlr_icon->drag->touch_id);
if (!point) {
return;
}
drag_icon->x = seat->touch_x;
drag_icon->y = seat->touch_y;
drag_icon->lx = seat->touch_lx;
drag_icon->ly = seat->touch_ly;
break;
}

6
seat.h
View file

@ -33,8 +33,8 @@ struct cg_seat {
struct wl_listener cursor_frame;
int32_t touch_id;
double touch_x;
double touch_y;
double touch_lx;
double touch_ly;
struct wl_listener touch_down;
struct wl_listener touch_up;
struct wl_listener touch_motion;
@ -80,7 +80,7 @@ struct cg_drag_icon {
struct wlr_drag_icon *wlr_drag_icon;
/* The drag icon has a position in layout coordinates. */
double x, y;
double lx, ly;
struct wl_listener destroy;
};