From cb966e51ea51088a1d4fd5914fc7f917684e0b51 Mon Sep 17 00:00:00 2001 From: Ioan-Adrian Ratiu Date: Thu, 28 Jan 2016 11:43:01 +0200 Subject: [PATCH] events: fix handling of touch events on window borders When the Xorg server translates touch events into ButtonPress/ButtonRelease events, the subwindow in the XEvent structure is set to zero. This change adds a querry to determine the subwindow for the event in case it is missing. Original patch & discussion at [1]. [1] http://xfce.10915.n7.nabble.com/Re-Xfwm-window-borders-do-not-respond-to-touch-screen-td42357.html Signed-off-by: Gratian Crisan Signed-off-by: Ioan-Adrian Ratiu --- src/events.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/events.c b/src/events.c index 8aa0f0a..0565594 100644 --- a/src/events.c +++ b/src/events.c @@ -917,6 +917,13 @@ handleButtonPress (DisplayInfo *display_info, XButtonEvent * ev) { state = ev->state & MODIFIER_MASK; win = ev->subwindow; + if (!win) { + Window root_ret; + int rx,ry,wx,wy; + unsigned int mask_ret; + XQueryPointer(display_info->dpy, ev->window, + &root_ret, &win, &rx, &ry, &wx, &wy, &mask_ret); + } screen_info = c->screen_info; if ((ev->button == Button1) && (state) && (state == screen_info->params->easy_click)) -- 2.7.0