#19265: wxGesture on touchscreen only: missing mouse move and click events when enabling touch events

57 views
Skip to first unread message

wxTrac

unread,
Sep 21, 2021, 5:17:24 AM9/21/21
to wx-...@googlegroups.com
#19265: wxGesture on touchscreen only: missing mouse move and click events when
enabling touch events
----------------------------+-------------------------
Reporter: tbultel | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Keywords: gesture, mouse | Blocked By:
Blocking: | Patch: 0
----------------------------+-------------------------
On this setup:
Ubuntu 21.04 on RPI 4

When using a touchscreen (UPERFECT Ui06) without an additional mouse,
and enabling either wxTOUCH_ZOOM_GESTURE, or wxTOUCH_PRESS_GESTURE,
mouse events that were caught with a callback like
EVT_MOUSE_EVENTS(MyFrame::MouseEvent)
do not report neither MouseMove events, nor LeftDown/LeftUp events
anymore.

Since wxTOUCH_PAN_GESTURE only work horizontally or vertically,
it is impossible to perform a diagonal scroll on a map, for instance.

Moreover, when some logics in the application requires an action on
LeftDown for instance (no LongPress), it is not possible to trig it
anymore.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19265>

wxTrac

unread,
Sep 22, 2021, 12:45:31 PM9/22/21
to wx-...@googlegroups.com
#19265: wxGesture on touchscreen only: missing mouse move and click events when
enabling touch events
----------------------+----------------------------
Reporter: tbultel | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Resolution: | Keywords: gesture, mouse
Blocked By: | Blocking:
Patch: 0 |
----------------------+----------------------------
Changes (by tbultel):

* cc: tbultel@… (added)


Comment:

At first analysis, the usage of the touch_callback

g_signal_connect (widget, "touch-event",
G_CALLBACK(touch_callback), win);

... hides the motion-notify-event
Instead, motion events are reported through the GDK_TOUCH_UPDATE
type in gdk_event->type in the touch_callback

But the current implementation does not forward a motion event in this
case...

Additionnaly ,'simple touch', that is to say a touch that is not long,
correctly leads to a GDK_TOUCH_BEGIN followed by a GDK_TOUCH_END,
and press events are masked.

As far as I understand, the fix would consists in the following things:
-> forwarding motion event. (A dirty fix that consists in calling
gtk_window_motion_notify_callback inthe GTK_TOUCH_UPDATE case works fine)

-> faking a LeftDown event upon GDK_TOUCH_BEGIN
-> faking a LeftUp event upon GDK_TOUCH_END

A can work on a patch for this but any comments are welcome !

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19265#comment:1>

wxTrac

unread,
Sep 24, 2021, 8:57:26 AM9/24/21
to wx-...@googlegroups.com
#19265: wxGesture on touchscreen only: missing mouse move and click events when
enabling touch events
----------------------+----------------------------
Reporter: tbultel | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Resolution: | Keywords: gesture, mouse
Blocked By: | Blocking:
Patch: 0 |
----------------------+----------------------------

Comment (by vadz):

Sorry, I can't even test this code as touch display on my Linux notebook
has stopped working a couple of years ago and I don't have any other
device running wxGTK with touch support (hmm, GTK for Android, anyone?),
so it's difficult for me to say anything useful about this problem.

But your explanation looks convincing and if you can actually test that
your patch implementing it works as expected, I'd be glad to apply it,
thanks in advance!

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19265#comment:2>

wxTrac

unread,
Oct 2, 2021, 9:06:54 AM10/2/21
to wx-...@googlegroups.com
#19265: wxGesture on touchscreen only: missing mouse move and click events when
enabling touch events
----------------------+-------------------------------------
Reporter: tbultel | Owner: Vadim Zeitlin <vadim@…>
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxGTK | Version: dev-latest
Resolution: fixed | Keywords: gesture, mouse
Blocked By: | Blocking:
Patch: 0 |
----------------------+-------------------------------------
Changes (by Vadim Zeitlin <vadim@…>):

* owner: => Vadim Zeitlin <vadim@…>
* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"746da37c4d569c024c3b92a6b198eaa50b5368fe/git-wxWidgets"
746da37c4/git-wxWidgets]:
{{{
#!CommitTicketReference repository="git-wxWidgets"
revision="746da37c4d569c024c3b92a6b198eaa50b5368fe"
Fix missing mouse events when using gesture events in wxGTK

When touch events were enabled, normal mouse move and click events were
not generated any longer. Fix this by doing the following two things:

First, emulate the LeftDown, LeftUp, and Motion events, that are no
longer triggered when using the "touch-event".

In addition, remove GDK_BUTTON1_MASK in the press callback, that is
never set when using a mouse, but that is set for some reason by GTK
when using a touchscreen.

See https://github.com/wxWidgets/wxWidgets/pull/2539

Closes #19265.

Signed-off-by: Thierry Bultel <tbu...@free.fr>
}}}

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19265#comment:3>
Reply all
Reply to author
Forward
0 new messages