Closed Bug 355792 Opened 18 years ago Closed 18 years ago

menus don't transfer active state correctly

Categories

(Core :: XUL, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: vlad, Unassigned)

References

Details

Attachments

(1 file)

While implementing native theme for Vista menus, I noticed the following problem on trunk, tested only on Vista:

If you have a menu bar with menus:  A  B  C
When you hover over A, you get   : _A_ B  C
When you click and hold A        : [A] B  C
When you then move the mouse to B:  A _B_ C
... even though the B menu drops down, because you're still holding the mouse button down.
When you move the mouse back to A: [A] B  C

I don't know if this was happening before, because the states for _A_ and [A] are identical in XP and in gtk2.   In the above, when you move the mouse to B, it should be drawn with [B] and not _B_.

I'm checking the state using the native theme code's GetContentState, which basically calls nsEventStateManager::GetContentState in this case.  For [A], both NS_EVENT_STATE_ACTIVE and NS_EVENT_STATE_HOVER are set.  NS_EVENT_STATE_ACTIVE remains in effect on A even when the mouse is moved to B, but it loses the _HOVER state, which is transferred over to B.
Attached image broken active menu
Screenshot of the problem.  The mouse was originally depressed over the Bookmarks menu, and was then moved to the History menu.  The Bookmarks menu retains the active state (and is drawn as active), while the History menu just gets the hover state.
This is actually bogus, after talking to dbaron; menus don't use the EventStateManager, and it's only entirely by accident that my code worked.  They probably /should/ mind you, but there are some odd things that would have to be handled (e.g. the definition of "hover" in light of keyboard menu navigation).
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: xptoolkit.menus → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: