Handle WM_POINTER* events in favor of WM_TOUCH#991
Handle WM_POINTER* events in favor of WM_TOUCH#991Osspial merged 2 commits intorust-windowing:masterfrom
Conversation
|
Some meta suggestions regarding this PR:
|
|
Hey folks, I noticed you were on the windows testing list. @0xpr03, and @FliegendeWurst Can one of you two test this on windows 7? @arthrp, and @notriddle Can one of you two test this on windows 8 or 10? Thanks. |
|
Build & Tests pass on win 7 |
|
Update: All examples are broken with (window example): RUST_BACKTRACE doesn't output anything, so if there's a way, tell me how I can provide more information. |
|
As i've mentioned, the functions needed by these events are not available on Windows 7 and older. I couldn't find anything about how Rust links FFI functions and I assumed that it uses dynamic linking. Because handling WM_TOUCH already breaks pre-Windows 7 compatibility, i guess that it's not priority for winit to support Windows XP. So we should load those functions dynamically through LoadLibrary and GetProcAddress. I've found an example usage of GetProcAddress in 'platform_impl/windows/dpi.rs', where a 'get_function' macro is defined to ease this process. Maybe this macro and it's accompanying function should be moved into 'platform_impl/windows/util.rs' and made visible within the whole module. |
|
We probably don't want support for anything older, but windows 7 is still supported and will be for longer on the industry side, so I'd personally not drop w7 support for now. |
|
@Osspial Should i create a separate PR for moving the dynamic function loading macro? |
|
@dam4rus Nah, adding it in this PR is fine. |
|
@0xpr03 It should work now. Can you test it? |
|
@dam4rus yes, current version works with examples |
|
Actually, one last thing - does this add multitouch support? If so, the relevant line in the feature matrix should get updated. |
|
WM_TOUCH already handled multiple touch points (AFAIK) and so does WM_POINTER. So, it depends on what you mean by multitouch support? This just sends individual touch events for every touch point like the WM_TOUCH implementation. The client can store these events to handle simultaneous touch points. Even so, it's kinda hard to tell what's a "touch event frame" with the current implementation. |
|
Ah, I suppose that should just be marked with a checkmark instead of a question mark, then. I'll merge this now and correct that. |
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.
Fixes #975
Haven't tested on Windows 7, but it should work, since the POINTER events are only fired on Windows 8 or higher. It should be tested anyway because GetPointerFrameInfoHistory and SkipPointerFrameMessages doesn't exist in User32.dll on pre-Windows 8.
cargo fmthas been run on this branchCHANGELOG.mdif knowledge of this change could be valuable to users