xwayland: Use double
for xwl_tablet_tool
So we do not lose subpixel precision in Xwayland.
Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Closes: https://gitlab.freedesktop.org/libinput/libinput/issues/138
(cherry picked from commit 734b2d6907
)
This commit is contained in:
parent
fb01b238c6
commit
c26a47b4f2
|
@ -1604,8 +1604,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool,
|
|||
struct xwl_tablet_tool *xwl_tablet_tool = data;
|
||||
struct xwl_seat *xwl_seat = xwl_tablet_tool->seat;
|
||||
int32_t dx, dy;
|
||||
int sx = wl_fixed_to_int(x);
|
||||
int sy = wl_fixed_to_int(y);
|
||||
double sx = wl_fixed_to_double(x);
|
||||
double sy = wl_fixed_to_double(y);
|
||||
|
||||
if (!xwl_seat->tablet_focus_window)
|
||||
return;
|
||||
|
@ -1613,8 +1613,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool,
|
|||
dx = xwl_seat->tablet_focus_window->window->drawable.x;
|
||||
dy = xwl_seat->tablet_focus_window->window->drawable.y;
|
||||
|
||||
xwl_tablet_tool->x = dx + sx;
|
||||
xwl_tablet_tool->y = dy + sy;
|
||||
xwl_tablet_tool->x = (double) dx + sx;
|
||||
xwl_tablet_tool->y = (double) dy + sy;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1772,15 +1772,15 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time)
|
|||
int button;
|
||||
|
||||
valuator_mask_zero(&mask);
|
||||
valuator_mask_set(&mask, 0, xwl_tablet_tool->x);
|
||||
valuator_mask_set(&mask, 1, xwl_tablet_tool->y);
|
||||
valuator_mask_set_double(&mask, 0, xwl_tablet_tool->x);
|
||||
valuator_mask_set_double(&mask, 1, xwl_tablet_tool->y);
|
||||
valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure);
|
||||
valuator_mask_set(&mask, 3, xwl_tablet_tool->tilt_x);
|
||||
valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y);
|
||||
valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider);
|
||||
valuator_mask_set_double(&mask, 3, xwl_tablet_tool->tilt_x);
|
||||
valuator_mask_set_double(&mask, 4, xwl_tablet_tool->tilt_y);
|
||||
valuator_mask_set_double(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider);
|
||||
|
||||
QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0,
|
||||
POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
|
||||
POINTER_ABSOLUTE | POINTER_DESKTOP, &mask);
|
||||
|
||||
valuator_mask_zero(&mask);
|
||||
|
||||
|
|
|
@ -311,13 +311,13 @@ struct xwl_tablet_tool {
|
|||
|
||||
DeviceIntPtr xdevice;
|
||||
uint32_t proximity_in_serial;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
double x;
|
||||
double y;
|
||||
uint32_t pressure;
|
||||
float tilt_x;
|
||||
float tilt_y;
|
||||
float rotation;
|
||||
float slider;
|
||||
double tilt_x;
|
||||
double tilt_y;
|
||||
double rotation;
|
||||
double slider;
|
||||
|
||||
uint32_t buttons_now,
|
||||
buttons_prev;
|
||||
|
|
Loading…
Reference in New Issue
Block a user