-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Steps to Reproduce
-
Create a small application with a MenuStrip, containing a single menu item, which contains a single item in its dropdown, which contains a single item. e.g, something like this:
(this form contains no code other than the code generated by the designer in Visual Studio) -
Assuming the names in the screenshot, click on "File", put your mouse over the "Test" item and then move your mouse again and click anywhere on the form, outside of the Menustrip and its opened dropdowns, e.g anywhere inside the red outline here:
-
The result will be that the dropdown containing the "Submenu" item will disappear, but the dropdown containing the "Test" item will remain, no matter how many times the form is clicked. e.g:
The only way to close the dropdown at this point is to click on the menustrip, or outside the form itself.
Current Behavior
The dropdowns do not close as expected when clicking outside the dropdown menus.
Expected Behavior
The dropdowns should all disappear when clicking outside of the dropdowns/menu.
On which platforms did you notice this
[ ] macOS
[x] Linux - Ubuntu 18.04
[ ] Windows
Version Used:
Mono 5.18.0.240 (tarball Wed Jan 16 09:10:16 UTC 2019) has the issue.
Additional information
I've gone through some of the recent changes to ToolStripItem-related code and the most likely cause I've found would be this change to Application.cs:
247a13b#diff-cf97a8c9e0ae37f2b3fd035ab966f3d2
Specifically, the ToolStripManager.FireAppClicked() function is no longer called in most scenarios (which may be intended).
The version of Mono that is available in Ubuntu 18.04's default packages (4.6.2.7+dfsg-1ubuntu1) does not have this problem - the menus close properly when following the steps above.
Slightly related issue about font size in ToolStripItems
There also appears to be another issue with the font size for menu items in 5.18, here is the same application running on a copy of my Ubuntu 18.04 VM before upgrading to Mono 5.18:
The font size is much smaller in 4.6.2, which is what I would expect. This appears to affect all "ToolStripItem"s (context menus, menu strips, toolstrips, etc.)
(Apologies for posting about 2 separate issues in here)
Edit: After testing with 5.10.1.47, I can confirm that neither issue is present in that build. In 5.10.1.47, the toolstrip menus close as expected, and the font size for toolstrip items is the same as it was in 4.6.2.
Edit 2: I've confirmed that reverting the change to Application.cs linked above does solve the issue with dropdowns not closing when expected. However, without knowing what specific use cases this particular change was originally done for, reverting is probably not the best solution.