From 6ce3d0249d426e6b3c83e7f86d76bb3145c00a74 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 26 Jun 2017 18:27:10 +1000 Subject: [PATCH] Post a motion event before a tablet button down Not all clients update the pointer position correctly from the button events (for historical reasons) so we need to send a motion event before the button event that represents a tip state change. https://bugs.freedesktop.org/show_bug.cgi?id=101588 Signed-off-by: Peter Hutterer --- src/xf86libinput.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index fa31b78..5727040 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -212,6 +212,10 @@ update_mode_prop(InputInfoPtr pInfo, static enum event_handling xf86libinput_handle_event(struct libinput_event *event); +static void +xf86libinput_post_tablet_motion(InputInfoPtr pInfo, + struct libinput_event_tablet_tool *event); + static inline int use_server_fd(const InputInfoPtr pInfo) { return pInfo->fd > -1 && (pInfo->flags & XI86_SERVER_FD); @@ -1716,12 +1720,15 @@ static enum event_handling xf86libinput_handle_tablet_tip(InputInfoPtr pInfo, struct libinput_event_tablet_tool *event) { + DeviceIntPtr pDev = pInfo->dev; enum libinput_tablet_tool_tip_state state; const BOOL is_absolute = TRUE; if (xf86libinput_tool_queue_event(event)) return EVENT_QUEUED; + xf86libinput_post_tablet_motion(pDev->public.devicePrivate, event); + state = libinput_event_tablet_tool_get_tip_state(event); xf86PostButtonEventP(pInfo->dev,