Bug 446805

Summary: ComboBox doesn't generate DropDownClosed when setting DroppedDown = false
Product: [Mono] Mono: Class Libraries Reporter: Mario Carrion <mcarrion>
Component: Windows.FormsAssignee: Jonathan Pobst <jpobst>
Status: VERIFIED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: SVN   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.0   
Whiteboard: ComboBox
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 428649    
Attachments: Combobox example
Proposed patch
Proposed Patch

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.