-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
MetroWindow: Application Crash on Double-Clicking Upper Left Icon #4445
Comments
@Fishayyy Hi, do you have an exception or something else which we can investigate? |
Unfortunately I have tried changing my debug settings to catch all unhandled exceptions and it appears that none are being thrown which makes me think that the application is actually closing instead of crashing. I also don't see anything in the Windows Event Viewer. I'm going to try and look through some of the code related to the MetroWindow Icon to see if I can find anything useful. |
I found the code responsible for the behavior here: MahApps.Metro/src/MahApps.Metro/Controls/MetroWindow.cs Lines 1530 to 1545 in 4b5ad8f
Given that this is a private event for the MetroWindow is there a way I can prevent this behavior? |
@Fishayyy This close behavior is the same as for other windows programs, just tested it with the explorer and it does exactly the same. |
@Fishayyy The only difference is that if the menu is already open it will close on another single click on the icoon. |
@punker76 interesting enough, it is not the default behavior for all programs. In win10 it does close explorer for me, in Win11 not. Some other programs do close, others not. So maybe this should be configurable somehow 🤔
|
@punker76 wow, all these years and I never even noticed that. I'll have to try that out tomorrow as a sanity check. It would still be nice if I can find a way to prevent that, but that's an interesting realization! I suppose this bug report can be closed out if it's not really a bug. Thank you for the insight! |
I like this idea! I've been playing around with different apps today and it defiantly seems like the default Windows behavior is to open system menu on click and close the window on double click for all my Microsoft Office apps and a few other various apps, but then there are things like Visual Studio Code and the Calculator app that treat the icon as a part of the title bar. |
Add new property CloseOnIconDoubleClick to allow disable closing window if the user double clicks on window icon.
Description
Issue: Double-clicking the icon in the upper left corner of a
MetroWindow
causes the application to crash. This behavior is observed even in the MahApps demo application.Expected Behavior: Double-clicking the icon typically opens then closes the system menu, or should do nothing if 'ShowSystemMenu' is set to 'False'.
Actual Behavior: The application crashes upon double-clicking the upper left window icon.
Steps to Reproduce
MetroWindow
from MahApps.This issue is also reproducible in the official MahApps demo application.
Environment
Additional Context
The text was updated successfully, but these errors were encountered: