diff options
author | Derek Foreman <derek.foreman@collabora.com> | 2022-02-07 13:56:28 -0600 |
---|---|---|
committer | Derek Foreman <derek.foreman@collabora.com> | 2023-06-12 16:58:17 -0500 |
commit | 0bf2d82e0c4509aa5c09442cd3159d8191a0dbc6 (patch) | |
tree | f7073871e3c99b0eb028dfdd3ee8fff1f9c5dd2f /kiosk-shell | |
parent | e8208d21d75b24929a3103e4ffd87c72284a714b (diff) |
libweston: Use weston_coord in struct weston_touch
Convert the grab coordinate to a weston_coord.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Diffstat (limited to 'kiosk-shell')
-rw-r--r-- | kiosk-shell/kiosk-shell-grab.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kiosk-shell/kiosk-shell-grab.c b/kiosk-shell/kiosk-shell-grab.c index 86363f82..8193b250 100644 --- a/kiosk-shell/kiosk-shell-grab.c +++ b/kiosk-shell/kiosk-shell-grab.c @@ -171,8 +171,8 @@ touch_move_grab_motion(struct weston_touch_grab *touch_grab, surface = weston_desktop_surface_get_surface(shsurf->desktop_surface); - dx = wl_fixed_to_int(touch->grab_x + shgrab->dx); - dy = wl_fixed_to_int(touch->grab_y + shgrab->dy); + dx = (int)(touch->grab_pos.c.x + wl_fixed_to_double(shgrab->dx)); + dy = (int)(touch->grab_pos.c.y + wl_fixed_to_double(shgrab->dy)); pos.c = weston_coord(dx, dy); weston_view_set_position(shsurf->view, pos); @@ -274,6 +274,7 @@ kiosk_shell_grab_start_for_touch_move(struct kiosk_shell_surface *shsurf, struct weston_touch *touch) { struct kiosk_shell_grab *shgrab; + struct weston_coord_global pos; if (!shsurf) return KIOSK_SHELL_GRAB_RESULT_ERROR; @@ -287,10 +288,10 @@ kiosk_shell_grab_start_for_touch_move(struct kiosk_shell_surface *shsurf, if (!shgrab) return KIOSK_SHELL_GRAB_RESULT_ERROR; - shgrab->dx = wl_fixed_from_double(shsurf->view->geometry.pos_offset.x) - - touch->grab_x; - shgrab->dy = wl_fixed_from_double(shsurf->view->geometry.pos_offset.y) - - touch->grab_y; + pos.c = weston_coord_sub(shsurf->view->geometry.pos_offset, + touch->grab_pos.c); + shgrab->dx = wl_fixed_from_double(pos.c.x); + shgrab->dy = wl_fixed_from_double(pos.c.y); shgrab->active = true; weston_seat_break_desktop_grabs(touch->seat); |