This PR fixes several issues with gesture handling in wxGTK. The most severe issue is #26211, which is that gesture cancellation can result in spurious gesture end events. Another issue is that gesture handling used several global variables, even though there can be multiple independent gestures of the same type active in different windows.
I have tested the changes with both a touchpad and a touchscreen and everything seems to work perfectly. Since I don't have an actual touchscreen, I did the testing by configuring my system to recognize my touchpad as a touchscreen. I have tested:
I was able to trigger two pan gestures at once in Weston by modifying the sample to open two windows, and using a touchscreen in one window and a mouse in the other. The existing code was horribly broken in this scenario, this PR fixes it.
https://github.com/wxWidgets/wxWidgets/pull/26241
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz approved this pull request.
Thanks, I'm unable to test this (if anybody else can, please leave a comment!), but the changes look good to me.
Ideal would be to split this into several commits, e.g. one for moving gs_xxx into wxWindowGesturesData, maybe another one for the angle confusion fix and then the other changes, so perhaps I'll try doing this when applying it. But if I fail to do it quickly, I'll just apply this as is as it seems important to have it in 3.3.2.
Thanks again!
> wxRotateGestureEvent event(win->GetId());
event.SetEventObject(win);
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
event.SetGestureStart();
+ event.SetRotationAngle(0);
Not very important, but this is the default, why call it explicitly?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@filip-hejsek commented on this pull request.
> wxRotateGestureEvent event(win->GetId());
event.SetEventObject(win);
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
event.SetGestureStart();
+ event.SetRotationAngle(0);
To make it extra clear that the value is the same as what we assign to m_lastAngleDelta. Fell free to remove this (along with event.SetZoomFactor(1); in the zoom callback).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@filip-hejsek pushed 4 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@filip-hejsek commented on this pull request.
> wxRotateGestureEvent event(win->GetId());
event.SetEventObject(win);
event.SetPosition(wxPoint(wxRound(x), wxRound(y)));
event.SetGestureStart();
+ event.SetRotationAngle(0);
Removed now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Ideal would be to split this into several commits, e.g. one for moving
gs_xxxintowxWindowGesturesData, maybe another one for the angle confusion fix and then the other changes, so perhaps I'll try doing this when applying it. But if I fail to do it quickly, I'll just apply this as is as it seems important to have it in 3.3.2.
I did the extra work to separate the changes. I didn't at all test the intermediate states this created though.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Nice, thanks a lot for doing this! Will merge soon but probably not today.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()