[Bug 1114] Winrar2.90/3.00: Comboex doesn't trigger a event when you mouse-click in some value of it

Wine Bugs wine-bugs at winehq.org
Sun May 1 12:17:43 CDT 2005


http://bugs.winehq.org/show_bug.cgi?id=1114





------- Additional Comments From felix.nawothnig at t-online.de  2005-01-05 12:17 -------
Since noone answered on the ML...

The listbox of WinRAR isn't updated because CBN_SELENDOK isn't sent.

CBN_SELENDOK is supposed to be sent by CBRollUp() called by the LBN_SELCHANGE
handler but isn't because the listbox (of the combobox) is already rolled up
when LBN_SELCHANGE is received.

The premature CBRollUp() is caused by a click into the combo/listbox which
SetFocus()es the listbox which causes a KILLFOCUS sent to the edit control which
was holding the focus before and then forwards the KILLFOCUS to it's parent (the
ComboLBox) which rolls the listbox up and issues CBN_SELENDCANCEL.

(This causes also a visible difference between native and builtin comctl32
native ComboBoxEx rolls up on mouseup, ours rolls up on mousedown)

So the problem is that the editbox has the focus although the listbox is rolled
down - this is the case for DROPDOWN comboboxes but only possible since the
listbox takes care of this special case and forwards the focus to the edit control.

Since a ComboBoxEx is a DROPDOWNLIST with an edit control drawn itself the
editbox has to lose the focus when the listbox is rolled down.

The listbox code actually takes care of that and sets the focus to the listbox
if it's not child of a DROPDOWN CB but the CBN_SETFOCUS handling in comboex.c
sets the focus back to the edit control for some reason, stating:

         * We also need to set the focus back to the Edit control
         * after passing the command to the parent of the ComboEx.

Putting an "case CBN_SETFOCUS:" before the CBN_SELENDOK case (making sure that
the focus isn't set to the edit control after a CBN_SETFOCUS) makes WinRAR work,
makes the listbox roll up on mouseup (looks exactly like native comctl32) and
doesn't seem to cause any problems.

This is definitly the right behaviour for CBN_SETFOCUS, I traced native comctl32
and it does not change the focus - but I'm not sure if this would just be hiding
another bug: do we *ever* need to change focus back to the edit control in CBN_*
handlers?

MSDN doesn't say anything about this... but that's hardly a suprise. :)

If the ComboBoxEx receives another CBN_* (except those handled by case
statements of which most *don't* set the focus to the edit box) while it's
rolled down it will set the focus back to the edit control and when the user
then selects an item it will again roll up (on button *down*) and send
CBN_SELENDCANCEL.

We could check if it's rolled down and just switch focus "back" (I fail to see
how the edit box could *not* be focused when the combobox is rolled up anyway?)
if it isn't - but unless comctl32 does this by non-standard means it doesn't
behave that way.

Completly removing the "forward focus to edit box" in the default case doesn't
seem to break anything and looks like the way native comctl32 behaves.

Right solution?

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list