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

ShowCursor(false) doesn't work. Window not created on UI thread? #10128

Closed
tom-huntington opened this issue Nov 1, 2024 · 2 comments
Closed
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@tom-huntington
Copy link

tom-huntington commented Nov 1, 2024

Describe the bug

I cant hide the cursor with ShowCursor

During the conversion to Win32, the cursor show counter became a thread-local state. (Naturally, multiple threads could merge their cursor show counters by attachment.) Consequently, when a thread calls ShowCursor it affects the cursor show state only for windows that belong to that thread.

https://devblogs.microsoft.com/oldnewthing/20091217-00

This suggests the UI thread was not used to create the window.

Steps to reproduce the bug

https://github.com/tom-huntington/ShowCursorMRE

Expected behavior

I expect some way to hide the cursor

NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

Windows version

Windows 11 (21H2): Build 22000

@tom-huntington tom-huntington added the bug Something isn't working label Nov 1, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 1, 2024
@castorix
Copy link

castorix commented Nov 2, 2024

ShowCursor is for Win32 cursors
You can change/hide cursor for XAML UIElements with ProtectedCursor
(threads like microsoft/WindowsAppSDK#1816, microsoft/WindowsAppSDK#3601, ...)

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage Issue needs to be triaged by the area owners label Nov 2, 2024
@tom-huntington
Copy link
Author

I noticed that ShowCursor does in fact hide the cursor... for the window chrome. Some how this is getting overwritten for the client region.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

2 participants