Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle WM_POINTER* events in favor of WM_TOUCH #975

Closed
dam4rus opened this issue Jun 24, 2019 · 5 comments · Fixed by #991
Closed

Handle WM_POINTER* events in favor of WM_TOUCH #975

dam4rus opened this issue Jun 24, 2019 · 5 comments · Fixed by #991
Labels
B - bug Dang, that shouldn't have happened DS - windows S - enhancement Wouldn't this be the coolest?

Comments

@dam4rus
Copy link
Contributor

dam4rus commented Jun 24, 2019

As WM_TOUCH have some well document problems, I think it would be more appropriate to handle the WM_POINTERDOWN, WM_POINTERUPDATE and WM_POINTERUP event family whenever possible. Even though these events are only sent by Windows 8.1 or higher, they are more robust, easier to set up (no need to call Un-/RegisterTouchWindow) and less error prone.

@dam4rus
Copy link
Contributor Author

dam4rus commented Jun 24, 2019

As a side note, I read your call for help and even though i'm totally new to open source contribution, I would gladly help when- and where-ever i can. I have a full-time job as C++/Windows desktop application developer, so i have some experience with WinAPI, and would gladly learn and help with X11 stuff.

@goddessfreya goddessfreya added DS - windows B - bug Dang, that shouldn't have happened S - enhancement Wouldn't this be the coolest? labels Jun 26, 2019
@Osspial
Copy link
Contributor

Osspial commented Jun 27, 2019

Hi, and thanks for bringing this up/volunteering! Sorry about the delay in a response.

I can't see any much in the way of downsides in adding this. I don't have easy access to a Windows touchscreen device, so would you be able to implement this? I'd give mentoring instructions, but given the nature of this bug report you seem to have a good handle on how to go about making this change.

dam4rus pushed a commit to dam4rus/winit that referenced this issue Jun 27, 2019
@dam4rus
Copy link
Contributor Author

dam4rus commented Jun 27, 2019

No problem about the delay. I created a PR for this issue.

During testing I noticed that touch events' location are screen coordinates, not client coordinates like mouse events. This is the default behavior on Windows, but is this the desired behavior for winit too?

felixrabe pushed a commit to felixrabe/winit that referenced this issue Jun 27, 2019
felixrabe pushed a commit to felixrabe/winit that referenced this issue Jun 27, 2019
@Osspial
Copy link
Contributor

Osspial commented Jun 27, 2019

Thanks! And, we should translate into client area coordinates. That'll be more consistent with the rest of the API, and expressing the event in screen coordinates isn't actually possible on all backends (Wayland being the main exception I'm aware of).

@dam4rus
Copy link
Contributor Author

dam4rus commented Jul 2, 2019

Sorry for the late answer! I've created a new issue for touch events emitting screen coordinates.

dam4rus pushed a commit to dam4rus/winit that referenced this issue Jul 5, 2019
dam4rus pushed a commit to dam4rus/winit that referenced this issue Jul 8, 2019
dam4rus pushed a commit to dam4rus/winit that referenced this issue Jul 8, 2019
felixrabe pushed a commit to felixrabe/winit that referenced this issue Jul 10, 2019
felixrabe pushed a commit to felixrabe/winit that referenced this issue Jul 10, 2019
kosyak pushed a commit to kosyak/winit that referenced this issue Jul 10, 2019
kosyak pushed a commit to kosyak/winit that referenced this issue Jul 10, 2019
Osspial added a commit to Osspial/winit that referenced this issue Jul 11, 2019
commit 026b331
Author: Kalmár Róbert <[email protected]>
Date:   Fri Jul 5 18:37:25 2019 +0200

    Handle WM_POINTER* events in favor of WM_TOUCH

    Fixes rust-windowing#975

commit 93c36cc
Author: Kalmar Robert <[email protected]>
Date:   Thu Jun 27 11:34:38 2019 +0200

    Handle WM_POINTER* events in favor of WM_TOUCH

    Fixes rust-windowing#975.
dam4rus pushed a commit to dam4rus/winit that referenced this issue Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - windows S - enhancement Wouldn't this be the coolest?
Development

Successfully merging a pull request may close this issue.

3 participants