Bug 446805 - ComboBox doesn't generate DropDownClosed when setting DroppedDown = false
Summary: ComboBox doesn't generate DropDownClosed when setting DroppedDown = false
Status: VERIFIED FIXED
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: Windows.Forms (show other bugs)
Version: SVN
Hardware: x86 openSUSE 11.0
: P5 - None : Normal
Target Milestone: ---
Assignee: Jonathan Pobst
QA Contact: Mono Bugs
URL:
Whiteboard: ComboBox
Keywords:
Depends on:
Blocks: 428649
  Show dependency treegraph
 
Reported: 2008-11-19 21:19 UTC by Mario Carrion
Modified: 2008-11-21 21:22 UTC (History)
0 users

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Combobox example (965 bytes, text/plain)
2008-11-19 21:19 UTC, Mario Carrion
Details
Proposed patch (419 bytes, patch)
2008-11-20 00:22 UTC, Andres Aragoneses
Details | Diff
Proposed Patch (375 bytes, text/plain)
2008-11-20 15:34 UTC, Jonathan Pobst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Carrion 2008-11-19 21:19:28 UTC
Created attachment 253638 [details]
Combobox example

Build:

gmcs -r:System.Windows.Forms,System.Drawing,System combobox.cs

and run

If you click the ComboBox's button you will see the messages: "dropped" when the list appears and "closed" when the list disappears.

Now, click the "Expand/Collapse", you will only see "dropped" when the list appears but you won't seen "closed" when the list disappears.

Works in .NET.
Comment 1 Mario Carrion 2008-11-19 21:20:12 UTC
BTW, I'm using the mono-2-2 branch.
Comment 2 Andres Aragoneses 2008-11-19 21:22:57 UTC
This is blocking ComboBox support in UIA :(
Comment 3 Andres Aragoneses 2008-11-20 00:22:04 UTC
Created attachment 253692 [details]
Proposed patch

Please review.

Thanks :)
Comment 4 Andres Aragoneses 2008-11-20 14:59:21 UTC
All tests pass after applying the patch.

Jonathan, could you review? Thanks!
Comment 5 Jonathan Pobst 2008-11-20 15:34:52 UTC
Created attachment 253962 [details]
Proposed Patch

How about this instead?

If you click the button repeatedly in your test case, the dropdown only drops down once, because dropped_down is never getting set back to false.  This patch should fix your issue and that one as well.
Comment 6 Andres Aragoneses 2008-11-20 15:57:22 UTC
Yes, that patch works also for me. Can you commit? Thanks!
Comment 7 Jonathan Pobst 2008-11-20 16:07:19 UTC
Fixed in r119450.  Thanks for the report and patch testing!

2008-11-20  Jonathan Pobst  <monkey@jpobst.com>

	* ComboBox.cs: Call HideWindow instead of Hide when closing the dropdown
	through DroppedDown so the proper events get called and state gets reset.
	[Fixes bug #446805]
Comment 8 Jonathan Pobst 2008-11-21 00:23:46 UTC
Backported to 2.2 in r119561.
Comment 9 Andres Aragoneses 2008-11-21 21:22:44 UTC
Thanks very much.