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
Unexpected UI behavior after closing OpenFileDialog #3986
Comments
Can repro, confirmed that it's still a problem on master. |
This happens because a mouse down captures the pointer and then the dialog is shown, meaning that the main window doesn't receive the pointer up message to release the capture. WPF handles this by handling the WM_CANCEL message Not sure why it's not reproing on linux, not had chance to check yet. I guess at least on windows at least we should handle |
Can also reproduce with |
In my project I am subclassing the window so I can handle that message. Is there a way I could manually release mouse capture on WM_CANCELMODE before this gets fixed? EDIT: I didn't have to handle any low level stuff, I just called |
@SparkyTD glad you figured out the hack. That's what I was going to suggest. |
I have a Button to open the OpenFileDialog. AvaloniaUI version: 0.9.12 |
I have created a TextBlock that shows an OpenFileDialog on the PointerPressed event. If I close the dialog, the entire window will become sensitive to that PointerPressed event which means that no matter where I click on the window, the dialog keeps opening.
I've tried setting the Cursor property of the TextBlock to Hand. Before clicking on it, the cursor only changes when I hover over it as expected. But after opening and closing the OFD, the entire window has the Hand cursor.
It looks like the OFD somehow confuses the hit testing code so it thinks that the entire window is that one label.
This bug affects Windows, I haven't been able to reproduce it on Linux (Manjaro) and I have no access to a Mac.
Here you can download a very simple project that demonstrated the bug. It only contains a window with a red label on the center. Click on the label then close the OFD (you don't have to select a file, but you can if you want to). Now no matter where you click on the window, the dialog will pop up.
dotNet: 3.1.2
Avalonia: 0.9.999-cibuild0007716-beta
OS: Windows 10 x64
The text was updated successfully, but these errors were encountered: