Add support for stylus buttons#183369
Conversation
|
@flutter/windows-reviewers can someone take a look? |
85c78f0 to
a356acd
Compare
There was a problem hiding this comment.
Code Review
This pull request adds support for inverted stylus devices and specific stylus buttons to the Windows embedder by refactoring pointer event handling to track button states per pointer ID. This allows for the detection of button transitions during pointer updates. The changes include new enums in the embedder API, helper functions for Win32 flag translation, and expanded unit tests. Feedback identifies a misleading comment in the flag translation logic, a redundant code block in the pointer info processing, and suggests simplifying the logic for identifying released buttons during pointer-up events.
|
cc @mattkae |
|
Addressed the reviews, ran the tests and tested it also in my flutter input demo. Theoretically I can also add button detection on pointer hover but I'm not sure if this is also implemented on other platforms. In this case, the first bit in the button mask is 0. |
|
I didn't touched any mac cis, so i think these fails can be ignored? |
|
@CodeDoctorDE I restarted those tests. If they fail again, please rebase your changes off the latest master commit. |
mattkae
left a comment
There was a problem hiding this comment.
I have no hardware with which to test this, but the code looks sensible to me!
loic-sharma
left a comment
There was a problem hiding this comment.
Thanks for the excellent patch, LGTM!
|
Reason for revert: This PR causes the Example failures: Example failures: |
|
Oh strange, I ran the tests before commiting. I will investigate it |
|
@CodeDoctorDE No worries! Normally our presubmit checks would've caught this, but the Windows embedder unit tests are currently suppressed due to capacity issues: #186597 This is what the test looks like currently if it fails, it's very easy to miss a failure:
|
|
I looked at it again and these problems seems like to be because of wrong test code (I added) where I don't have POINTER_FLAG_FIRSTBUTTON added to the pointer flags: - pointer_info->pointerFlags = POINTER_FLAG_INCONTACT;
+ pointer_info->pointerFlags = POINTER_FLAG_INCONTACT |
+ POINTER_FLAG_FIRSTBUTTON |
+ POINTER_FLAG_DOWN;This should be the correct pointer flags since down and first button should be always there With these changes the tests succeed again |
Roll Flutter from 2ba5420a7049 to 1bdf4af29076 (43 revisions) flutter/flutter@2ba5420...1bdf4af 2026-06-05 [email protected] Roll Packages from 03352b5 to 61bdbb4 (5 revisions) (flutter/flutter#187612) 2026-06-05 [email protected] Roll Skia from 6e003d7f69c8 to a47a9a2c8ae5 (1 revision) (flutter/flutter#187610) 2026-06-05 [email protected] Roll Dart SDK from aad8be4ce307 to 6a9a0efe66eb (10 revisions) (flutter/flutter#187609) 2026-06-05 [email protected] Roll Skia from 494f1bf55f51 to 6e003d7f69c8 (2 revisions) (flutter/flutter#187607) 2026-06-05 [email protected] Roll Fuchsia Linux SDK from ZE1Jy9CtVVi-tjBAE... to N_LiSaBSUsE2LDZgG... (flutter/flutter#187597) 2026-06-05 [email protected] Roll Skia from 59556fdb8c33 to 494f1bf55f51 (2 revisions) (flutter/flutter#187596) 2026-06-04 [email protected] Roll Skia from 8eb107046fd5 to 59556fdb8c33 (1 revision) (flutter/flutter#187590) 2026-06-04 [email protected] Remove `embedded_android_views_integration_test.dart` (flutter/flutter#187465) 2026-06-04 [email protected] Remove Material imports from rendering editable tests (flutter/flutter#186951) 2026-06-04 [email protected] [Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor (flutter/flutter#187477) 2026-06-04 [email protected] [iOS] Eliminate unnecessary redeclaration of FlutterDisplayLink (flutter/flutter#187557) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187583) 2026-06-04 [email protected] Log stdout in adb.dart (flutter/flutter#187531) 2026-06-04 [email protected] Clarify RouterDelegate popRoute bubbling (flutter/flutter#186875) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187584) 2026-06-04 [email protected] Add updating-android-sdk agent skill for rolling Android SDK in CIPD (flutter/flutter#187576) 2026-06-04 [email protected] Fixing alignment issue (flutter/flutter#187518) 2026-06-04 [email protected] [Material Cross Imports] Clean up Material Divider usages (flutter/flutter#187300) 2026-06-04 [email protected] Roll Skia from cecc0e0da9ae to 928ded2a31af (6 revisions) (flutter/flutter#187574) 2026-06-04 [email protected] Use swift demangle to verify internal Swift symbols (flutter/flutter#186835) 2026-06-04 [email protected] Add android 37 platform and build tools to script for android cipd bundle creation (flutter/flutter#187571) 2026-06-04 [email protected] [Impeller] Increase the precision of the IPSampleWithTileModeOES coords parameter to match the input coordinates in the tiled_texture_fill_external shader (flutter/flutter#187545) 2026-06-04 [email protected] Roll Packages from b11504f to 03352b5 (4 revisions) (flutter/flutter#187569) 2026-06-04 [email protected] Roll Dart SDK to Dart 3.13 beta2 (flutter/flutter#187555) 2026-06-04 [email protected] Roll Skia from 611e3f8ceb93 to cecc0e0da9ae (1 revision) (flutter/flutter#187562) 2026-06-04 [email protected] Add step to bootstrap Flutter tool in coverage workflow (flutter/flutter#187199) 2026-06-04 [email protected] Roll Skia from 4fdb859c8da7 to 611e3f8ceb93 (4 revisions) (flutter/flutter#187554) 2026-06-04 [email protected] Roll Skia from 0020aae33f63 to 4fdb859c8da7 (2 revisions) (flutter/flutter#187552) 2026-06-04 [email protected] Roll Fuchsia Linux SDK from ap7MhLX4TdpWRrLS_... to ZE1Jy9CtVVi-tjBAE... (flutter/flutter#187550) 2026-06-04 [email protected] Add vector_math to package issue template (flutter/flutter#187536) 2026-06-04 [email protected] Manual roll Dart SDK from d39850bf4a01 to 3b70b98fa7c0 (flutter/flutter#187519) 2026-06-04 [email protected] Roll Skia from d625048c853a to 0020aae33f63 (20 revisions) (flutter/flutter#187539) 2026-06-04 [email protected] [Impeller][Windows] fix black screen on OpenGL fallback (flutter/flutter#187288) 2026-06-04 [email protected] Fix unintentionally joined path contours (flutter/flutter#187522) 2026-06-03 [email protected] fix: resolve issue #177379 by using lazy buildDirectory.dir() API in build.gradle template (flutter/flutter#187127) 2026-06-03 [email protected] Add a skill for flake analysis (flutter/flutter#187530) 2026-06-03 [email protected] adds linux impeller project flag (flutter/flutter#186982) 2026-06-03 [email protected] Add support for stylus buttons (flutter/flutter#183369) 2026-06-03 [email protected] Prevent Cubic transform from looping on out-of-range input (flutter/flutter#185875) 2026-06-03 [email protected] [Impeller] Reland: Allow attaching specific texture mip levels and slices (flutter/flutter#187470) 2026-06-03 [email protected] [skia] Update image deserial proc (flutter/flutter#185041) 2026-06-03 [email protected] docs: update Impeller advanced blend docs for framebuffer fetch (flutter/flutter#185457) 2026-06-03 [email protected] Handle#6537 fifth grouped tests (flutter/flutter#183720) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: ...
Reverts: [Add support for stylus buttons](flutter#183369) Initiated by: @loic-sharma Reason for reverting: This PR causes the `Windows windows_host_engine_test` to fail. cc @CodeDoctorDE Original PR Author: @CodeDoctorDE Reviewed By: @mattkae The original PR description is provided below: Continuation of flutter#165323. Now we have stylus support on windows with the last pull request. This pull request now adds support for `invertedStylus` and stylus buttons (primary + secondary). The pull request shouldn't have any breaking changes other than the pointer event shows the correct button bitmap instead of `1` always on a stylus input. Should completly fix: flutter#102836. Tested on my notebook: <img width="1902" height="1071" alt="grafik" src="https://github.com/user-attachments/assets/1761336f-8db5-4da2-91b5-2c17bc92d698" /> repo for the demo code: https://github.com/CodeDoctorDE/flutter-input-demo **This pull request is currently a draft and my next steps is to add tests** ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…r#11849) Roll Flutter from 2ba5420a7049 to 1bdf4af29076 (43 revisions) flutter/flutter@2ba5420...1bdf4af 2026-06-05 [email protected] Roll Packages from 03352b5 to 61bdbb4 (5 revisions) (flutter/flutter#187612) 2026-06-05 [email protected] Roll Skia from 6e003d7f69c8 to a47a9a2c8ae5 (1 revision) (flutter/flutter#187610) 2026-06-05 [email protected] Roll Dart SDK from aad8be4ce307 to 6a9a0efe66eb (10 revisions) (flutter/flutter#187609) 2026-06-05 [email protected] Roll Skia from 494f1bf55f51 to 6e003d7f69c8 (2 revisions) (flutter/flutter#187607) 2026-06-05 [email protected] Roll Fuchsia Linux SDK from ZE1Jy9CtVVi-tjBAE... to N_LiSaBSUsE2LDZgG... (flutter/flutter#187597) 2026-06-05 [email protected] Roll Skia from 59556fdb8c33 to 494f1bf55f51 (2 revisions) (flutter/flutter#187596) 2026-06-04 [email protected] Roll Skia from 8eb107046fd5 to 59556fdb8c33 (1 revision) (flutter/flutter#187590) 2026-06-04 [email protected] Remove `embedded_android_views_integration_test.dart` (flutter/flutter#187465) 2026-06-04 [email protected] Remove Material imports from rendering editable tests (flutter/flutter#186951) 2026-06-04 [email protected] [Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor (flutter/flutter#187477) 2026-06-04 [email protected] [iOS] Eliminate unnecessary redeclaration of FlutterDisplayLink (flutter/flutter#187557) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187583) 2026-06-04 [email protected] Log stdout in adb.dart (flutter/flutter#187531) 2026-06-04 [email protected] Clarify RouterDelegate popRoute bubbling (flutter/flutter#186875) 2026-06-04 [email protected] Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187584) 2026-06-04 [email protected] Add updating-android-sdk agent skill for rolling Android SDK in CIPD (flutter/flutter#187576) 2026-06-04 [email protected] Fixing alignment issue (flutter/flutter#187518) 2026-06-04 [email protected] [Material Cross Imports] Clean up Material Divider usages (flutter/flutter#187300) 2026-06-04 [email protected] Roll Skia from cecc0e0da9ae to 928ded2a31af (6 revisions) (flutter/flutter#187574) 2026-06-04 [email protected] Use swift demangle to verify internal Swift symbols (flutter/flutter#186835) 2026-06-04 [email protected] Add android 37 platform and build tools to script for android cipd bundle creation (flutter/flutter#187571) 2026-06-04 [email protected] [Impeller] Increase the precision of the IPSampleWithTileModeOES coords parameter to match the input coordinates in the tiled_texture_fill_external shader (flutter/flutter#187545) 2026-06-04 [email protected] Roll Packages from b11504f to 03352b5 (4 revisions) (flutter/flutter#187569) 2026-06-04 [email protected] Roll Dart SDK to Dart 3.13 beta2 (flutter/flutter#187555) 2026-06-04 [email protected] Roll Skia from 611e3f8ceb93 to cecc0e0da9ae (1 revision) (flutter/flutter#187562) 2026-06-04 [email protected] Add step to bootstrap Flutter tool in coverage workflow (flutter/flutter#187199) 2026-06-04 [email protected] Roll Skia from 4fdb859c8da7 to 611e3f8ceb93 (4 revisions) (flutter/flutter#187554) 2026-06-04 [email protected] Roll Skia from 0020aae33f63 to 4fdb859c8da7 (2 revisions) (flutter/flutter#187552) 2026-06-04 [email protected] Roll Fuchsia Linux SDK from ap7MhLX4TdpWRrLS_... to ZE1Jy9CtVVi-tjBAE... (flutter/flutter#187550) 2026-06-04 [email protected] Add vector_math to package issue template (flutter/flutter#187536) 2026-06-04 [email protected] Manual roll Dart SDK from d39850bf4a01 to 3b70b98fa7c0 (flutter/flutter#187519) 2026-06-04 [email protected] Roll Skia from d625048c853a to 0020aae33f63 (20 revisions) (flutter/flutter#187539) 2026-06-04 [email protected] [Impeller][Windows] fix black screen on OpenGL fallback (flutter/flutter#187288) 2026-06-04 [email protected] Fix unintentionally joined path contours (flutter/flutter#187522) 2026-06-03 [email protected] fix: resolve issue #177379 by using lazy buildDirectory.dir() API in build.gradle template (flutter/flutter#187127) 2026-06-03 [email protected] Add a skill for flake analysis (flutter/flutter#187530) 2026-06-03 [email protected] adds linux impeller project flag (flutter/flutter#186982) 2026-06-03 [email protected] Add support for stylus buttons (flutter/flutter#183369) 2026-06-03 [email protected] Prevent Cubic transform from looping on out-of-range input (flutter/flutter#185875) 2026-06-03 [email protected] [Impeller] Reland: Allow attaching specific texture mip levels and slices (flutter/flutter#187470) 2026-06-03 [email protected] [skia] Update image deserial proc (flutter/flutter#185041) 2026-06-03 [email protected] docs: update Impeller advanced blend docs for framebuffer fetch (flutter/flutter#185457) 2026-06-03 [email protected] Handle#6537 fifth grouped tests (flutter/flutter#183720) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: ...
Relands flutter#183369, which was reverted in flutter#187581 after `Windows windows_host_engine_test` failed in `FlutterWindowTest.OnMousePointerDown`. The original PR continued the Windows stylus work from flutter#165323 and fixes flutter#102836. The original 8 commits from `windows/pointer-buttons` are squashed into a single reland commit. ## Fix for the reverted failure The revert was caused by a failing Windows unit test, not by the engine pointer button logic itself. The affected test mocked a pointer-down event with `POINTER_FLAG_INCONTACT`, but did not include the documented Win32 button/down flags needed for a primary button press. The engine now derives the Flutter button bitmap from the Windows pointer button flags, so the mock event needs to represent an actual primary-button down event. This reland adds the missing flags in the affected test data: - `POINTER_FLAG_FIRSTBUTTON` - `POINTER_FLAG_DOWN` This keeps the engine behavior aligned with the Win32 pointer input documentation instead of inferring a primary button from `POINTER_FLAG_INCONTACT` alone. See here: https://learn.microsoft.com/en-us/windows/win32/inputmsg/pointer-flags-contants. ## Tests Built successfully: - `.\src\flutter\bin\et.bat build` - `autoninja -C engine\src\out\host_debug flutter_windows_unittests client_wrapper_windows_unittests accessibility_unittests embedder_a11y_unittests embedder_proctable_unittests embedder_unittests` Ran relevant Windows/embedder tests: - `embedder_a11y_unittests --repeat=2`: passed - `embedder_proctable_unittests --repeat=2`: passed - `embedder_unittests --repeat=2`: passed - `accessibility_unittests --repeat=2`: passed - `client_wrapper_windows_unittests --repeat=2`: passed - `flutter_windows_unittests --repeat=2`: failed only in `KeyboardTest.DeadKeyTwiceThenLetter` due to local keyboard layout, expected `` ` `` but received `ö` Reran `flutter_windows_unittests` excluding only the unrelated local keyboard-layout test: - `flutter_windows_unittests --repeat=2 --gtest_filter=-KeyboardTest.DeadKeyTwiceThenLetter`: passed The previously failing `FlutterWindowTest.OnMousePointerDown` now passes. These are the logs for one run (where this test was failing previously): <details><summary>Details</summary> <p> ``` [INFO:flutter/testing/test_timeout_listener.cc(75)] Test timeout of 300 seconds per test case will be enforced. Note: Google Test filter = FlutterWindowTest.* [==========] Running 26 tests from 1 test suite. [----------] Global test environment set-up. [----------] 26 tests from FlutterWindowTest [ RUN ] FlutterWindowTest.CreateDestroy [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.CreateDestroy (152 ms) [ RUN ] FlutterWindowTest.OnBitmapSurfaceUpdated [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.OnBitmapSurfaceUpdated (56 ms) [ RUN ] FlutterWindowTest.OnCursorRectUpdatedRegularDPI [ OK ] FlutterWindowTest.OnCursorRectUpdatedRegularDPI (1 ms) [ RUN ] FlutterWindowTest.OnCursorRectUpdatedHighDPI [ OK ] FlutterWindowTest.OnCursorRectUpdatedHighDPI (0 ms) [ RUN ] FlutterWindowTest.OnPointerStarSendsDeviceType [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.OnPointerStarSendsDeviceType (56 ms) [ RUN ] FlutterWindowTest.OnStylusPointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerDown (6 ms) [ RUN ] FlutterWindowTest.OnStylusPointerMove [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerMove (5 ms) [ RUN ] FlutterWindowTest.OnStylusPointerUp [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerUp (14 ms) [ RUN ] FlutterWindowTest.OnStylusPointerLeave [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerLeave (8 ms) [ RUN ] FlutterWindowTest.OnStylusPointerHover [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerHover (9 ms) [ RUN ] FlutterWindowTest.OnStylusHoverAfterPointerUp [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusHoverAfterPointerUp (12 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUsesPenFlags [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUsesPenFlags (6 ms) [ RUN ] FlutterWindowTest.OnStylusEraserButtonUsesPenFlags [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusEraserButtonUsesPenFlags (6 ms) [ RUN ] FlutterWindowTest.OnInvertedStylusPointerDownUsesDeviceKind [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnInvertedStylusPointerDownUsesDeviceKind (6 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithUpdatedButtons [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithUpdatedButtons (13 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithReleasedButton [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithReleasedButton (10 ms) [ RUN ] FlutterWindowTest.OnMousePointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnMousePointerDown (4 ms) [ RUN ] FlutterWindowTest.OnTouchPointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnTouchPointerDown (6 ms) [ RUN ] FlutterWindowTest.PointerMessageScreenCoordinatesAreConvertedToClient [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.PointerMessageScreenCoordinatesAreConvertedToClient (5 ms) [ RUN ] FlutterWindowTest.OnScrollCallsGetScrollOffsetMultiplier [ OK ] FlutterWindowTest.OnScrollCallsGetScrollOffsetMultiplier (0 ms) [ RUN ] FlutterWindowTest.OnWindowRepaint [ OK ] FlutterWindowTest.OnWindowRepaint (0 ms) [ RUN ] FlutterWindowTest.OnThemeChange [ OK ] FlutterWindowTest.OnThemeChange (0 ms) [ RUN ] FlutterWindowTest.AccessibilityNodeWithoutView [ OK ] FlutterWindowTest.AccessibilityNodeWithoutView (0 ms) [ RUN ] FlutterWindowTest.AlertNode [ OK ] FlutterWindowTest.AlertNode (59 ms) [ RUN ] FlutterWindowTest.LifecycleFocusMessages [ OK ] FlutterWindowTest.LifecycleFocusMessages (0 ms) [ RUN ] FlutterWindowTest.CachedLifecycleMessage [ OK ] FlutterWindowTest.CachedLifecycleMessage (0 ms) [----------] 26 tests from FlutterWindowTest (478 ms total) [----------] Global test environment tear-down [==========] 26 tests from 1 test suite ran. (479 ms total) [ PASSED ] 26 tests. ``` </p> </details> ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Continuation of flutter#165323. Now we have stylus support on windows with the last pull request. This pull request now adds support for `invertedStylus` and stylus buttons (primary + secondary). The pull request shouldn't have any breaking changes other than the pointer event shows the correct button bitmap instead of `1` always on a stylus input. Should completly fix: flutter#102836. Tested on my notebook: <img width="1902" height="1071" alt="grafik" src="https://github.com/user-attachments/assets/1761336f-8db5-4da2-91b5-2c17bc92d698" /> repo for the demo code: https://github.com/CodeDoctorDE/flutter-input-demo **This pull request is currently a draft and my next steps is to add tests** ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Reverts: [Add support for stylus buttons](flutter#183369) Initiated by: @loic-sharma Reason for reverting: This PR causes the `Windows windows_host_engine_test` to fail. cc @CodeDoctorDE Original PR Author: @CodeDoctorDE Reviewed By: @mattkae The original PR description is provided below: Continuation of flutter#165323. Now we have stylus support on windows with the last pull request. This pull request now adds support for `invertedStylus` and stylus buttons (primary + secondary). The pull request shouldn't have any breaking changes other than the pointer event shows the correct button bitmap instead of `1` always on a stylus input. Should completly fix: flutter#102836. Tested on my notebook: <img width="1902" height="1071" alt="grafik" src="https://github.com/user-attachments/assets/1761336f-8db5-4da2-91b5-2c17bc92d698" /> repo for the demo code: https://github.com/CodeDoctorDE/flutter-input-demo **This pull request is currently a draft and my next steps is to add tests** ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Relands flutter#183369, which was reverted in flutter#187581 after `Windows windows_host_engine_test` failed in `FlutterWindowTest.OnMousePointerDown`. The original PR continued the Windows stylus work from flutter#165323 and fixes flutter#102836. The original 8 commits from `windows/pointer-buttons` are squashed into a single reland commit. ## Fix for the reverted failure The revert was caused by a failing Windows unit test, not by the engine pointer button logic itself. The affected test mocked a pointer-down event with `POINTER_FLAG_INCONTACT`, but did not include the documented Win32 button/down flags needed for a primary button press. The engine now derives the Flutter button bitmap from the Windows pointer button flags, so the mock event needs to represent an actual primary-button down event. This reland adds the missing flags in the affected test data: - `POINTER_FLAG_FIRSTBUTTON` - `POINTER_FLAG_DOWN` This keeps the engine behavior aligned with the Win32 pointer input documentation instead of inferring a primary button from `POINTER_FLAG_INCONTACT` alone. See here: https://learn.microsoft.com/en-us/windows/win32/inputmsg/pointer-flags-contants. ## Tests Built successfully: - `.\src\flutter\bin\et.bat build` - `autoninja -C engine\src\out\host_debug flutter_windows_unittests client_wrapper_windows_unittests accessibility_unittests embedder_a11y_unittests embedder_proctable_unittests embedder_unittests` Ran relevant Windows/embedder tests: - `embedder_a11y_unittests --repeat=2`: passed - `embedder_proctable_unittests --repeat=2`: passed - `embedder_unittests --repeat=2`: passed - `accessibility_unittests --repeat=2`: passed - `client_wrapper_windows_unittests --repeat=2`: passed - `flutter_windows_unittests --repeat=2`: failed only in `KeyboardTest.DeadKeyTwiceThenLetter` due to local keyboard layout, expected `` ` `` but received `ö` Reran `flutter_windows_unittests` excluding only the unrelated local keyboard-layout test: - `flutter_windows_unittests --repeat=2 --gtest_filter=-KeyboardTest.DeadKeyTwiceThenLetter`: passed The previously failing `FlutterWindowTest.OnMousePointerDown` now passes. These are the logs for one run (where this test was failing previously): <details><summary>Details</summary> <p> ``` [INFO:flutter/testing/test_timeout_listener.cc(75)] Test timeout of 300 seconds per test case will be enforced. Note: Google Test filter = FlutterWindowTest.* [==========] Running 26 tests from 1 test suite. [----------] Global test environment set-up. [----------] 26 tests from FlutterWindowTest [ RUN ] FlutterWindowTest.CreateDestroy [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.CreateDestroy (152 ms) [ RUN ] FlutterWindowTest.OnBitmapSurfaceUpdated [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.OnBitmapSurfaceUpdated (56 ms) [ RUN ] FlutterWindowTest.OnCursorRectUpdatedRegularDPI [ OK ] FlutterWindowTest.OnCursorRectUpdatedRegularDPI (1 ms) [ RUN ] FlutterWindowTest.OnCursorRectUpdatedHighDPI [ OK ] FlutterWindowTest.OnCursorRectUpdatedHighDPI (0 ms) [ RUN ] FlutterWindowTest.OnPointerStarSendsDeviceType [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.OnPointerStarSendsDeviceType (56 ms) [ RUN ] FlutterWindowTest.OnStylusPointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerDown (6 ms) [ RUN ] FlutterWindowTest.OnStylusPointerMove [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerMove (5 ms) [ RUN ] FlutterWindowTest.OnStylusPointerUp [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerUp (14 ms) [ RUN ] FlutterWindowTest.OnStylusPointerLeave [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerLeave (8 ms) [ RUN ] FlutterWindowTest.OnStylusPointerHover [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusPointerHover (9 ms) [ RUN ] FlutterWindowTest.OnStylusHoverAfterPointerUp [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusHoverAfterPointerUp (12 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUsesPenFlags [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUsesPenFlags (6 ms) [ RUN ] FlutterWindowTest.OnStylusEraserButtonUsesPenFlags [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusEraserButtonUsesPenFlags (6 ms) [ RUN ] FlutterWindowTest.OnInvertedStylusPointerDownUsesDeviceKind [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnInvertedStylusPointerDownUsesDeviceKind (6 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithUpdatedButtons [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithUpdatedButtons (13 ms) [ RUN ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithReleasedButton [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnStylusBarrelButtonUpdateMovesWithReleasedButton (10 ms) [ RUN ] FlutterWindowTest.OnMousePointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnMousePointerDown (4 ms) [ RUN ] FlutterWindowTest.OnTouchPointerDown [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed GMOCK WARNING: Uninteresting mock function call - returning directly. Function call: OnWindowStateEvent(4-byte object <00-00 00-00>) NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#knowing-when-to-expect-useoncall for details. [ OK ] FlutterWindowTest.OnTouchPointerDown (6 ms) [ RUN ] FlutterWindowTest.PointerMessageScreenCoordinatesAreConvertedToClient [ERROR:flutter/shell/platform/windows/direct_manipulation.cc(182)] CoCreateInstance(CLSID_DirectManipulationManager, nullptr, CLSCTX_INPROC_SERVER, IID_IDirectManipulationManager, &manager_) failed [ OK ] FlutterWindowTest.PointerMessageScreenCoordinatesAreConvertedToClient (5 ms) [ RUN ] FlutterWindowTest.OnScrollCallsGetScrollOffsetMultiplier [ OK ] FlutterWindowTest.OnScrollCallsGetScrollOffsetMultiplier (0 ms) [ RUN ] FlutterWindowTest.OnWindowRepaint [ OK ] FlutterWindowTest.OnWindowRepaint (0 ms) [ RUN ] FlutterWindowTest.OnThemeChange [ OK ] FlutterWindowTest.OnThemeChange (0 ms) [ RUN ] FlutterWindowTest.AccessibilityNodeWithoutView [ OK ] FlutterWindowTest.AccessibilityNodeWithoutView (0 ms) [ RUN ] FlutterWindowTest.AlertNode [ OK ] FlutterWindowTest.AlertNode (59 ms) [ RUN ] FlutterWindowTest.LifecycleFocusMessages [ OK ] FlutterWindowTest.LifecycleFocusMessages (0 ms) [ RUN ] FlutterWindowTest.CachedLifecycleMessage [ OK ] FlutterWindowTest.CachedLifecycleMessage (0 ms) [----------] 26 tests from FlutterWindowTest (478 ms total) [----------] Global test environment tear-down [==========] 26 tests from 1 test suite ran. (479 ms total) [ PASSED ] 26 tests. ``` </p> </details> ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
<!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This is my continuation of effort to improve stylus support in flutter. On linux flutter can detect stylus input type, but have missing information like rotation and pressure. In this pr, I add these. <img width="2055" height="1287" alt="image" src="https://github.com/user-attachments/assets/a5b6d83d-a2cd-40d6-9eb8-ca5580318f38" /> Tested on Fedora Linux 44, KDE Plasma with Wayland with an Wacom Stylus (same as in the windows stylus support pr) (orientation isn't supported by my stylus, i tested it on other apps so maybe anyone other can test it). Tested this pr on my flutter input demo: https://github.com/CodeDoctorDE/flutter-input-demo/tree/ad61c7d6f5011594a90cbb2b9840904144f877b5 (need to run flutter create . --platforms linux). Related issue: flutter#63209 My previous windows stylus support pr: flutter#165323 + the windows stylus button support pr: flutter#183369. This pr now adds pressure and tilt information and stylus button support on linux. **This work is based on the windows stylus button support pr which adds inverted stylus to the embedder** ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Robert Ancell <[email protected]>


Continuation of #165323.
Now we have stylus support on windows with the last pull request.
This pull request now adds support for
invertedStylusand stylus buttons (primary + secondary).The pull request shouldn't have any breaking changes other than the pointer event shows the correct button bitmap instead of
1always on a stylus input.Should completly fix: #102836.
Tested on my notebook:

repo for the demo code: https://github.com/CodeDoctorDE/flutter-input-demo
This pull request is currently a draft and my next steps is to add tests
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.