Closed Bug 356528 Opened 18 years ago Closed 18 years ago

XUL menu only hilights items on mouseover the first time opened

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: hwaara)

References

Details

(Whiteboard: [blocking1.9a1+])

Attachments

(2 files, 1 obsolete file)

To reproduce:

1. Open Cocoa Firefox
2. Click on a live bookmark in the bookmark bar
3. Mouse over menu items, notice that they hilite when the mouse is over them
4. Close the menu
5. Click on the same live bookmark in the bookmark bar, notice that menu items do not hilite on mouseover
Attached patch cleanup v1.0Splinter Review
When I was looking at our child view event handling code I found some of it to be strangely written, unclear, and inefficient. This patch doesn't change any behavior at all, but it reorganizes the code in a more clear and understandable way and removes some redundant checks.
Attachment #242155 - Flags: review?(mark)
Comment on attachment 242155 [details] [diff] [review]
cleanup v1.0

cleanup ok
Attachment #242155 - Flags: review?(mark) → review+
Attachment #242155 - Flags: superreview?(mikepinkerton)
Attachment #242155 - Flags: superreview?(mikepinkerton) → superreview+
cleanup checked in
Is this a dupe of #324963 or just something similar?
This is not a dupe of bug 324963.
I have figured out exactly what is going but I haven't found a fix yet.

The problem is that when you open a menu like a live bookmark the second time through, all of the mouse move events that get generated when you mouse over it are getting sent to the view in the window underneath it. Like the mouse move is going *through* the menu window. The result is that the mouse move events aren't targetting the view in the menu and getting forwarded to the menu's window object. Why this happens only the second time you open the menu and not the first I don't know.
>This is not a dupe of bug 324963.
>
>The problem is that when you open a menu like a live bookmark the second time
>through, all of the mouse move events that get generated when you mouse over it
>are getting sent to the view in the window underneath it.

That sounds like what is happening with 324963 IMO. The triggering mechanism might be different (so it not being an exact dupe) but the description people are having make it sound like the same underlying problem (see comment 7, etc. of that bug for example - https://bugzilla.mozilla.org/show_bug.cgi?id=324963#c7}.

I don't have any live bookmarks but do see this all the time with regular folders on the bookmark bar. No idea why it happens either but having a sub-folder pop up (and then never close which is another bug) will cause it to happen every time.
Flags: blocking1.9+
Whiteboard: [blocking1.9a1+]
Attached patch Fix (obsolete) — Splinter Review
That was fun. Because of all our popup window trouble, I wrote a test app where I recreated how our popupmenus work, and thus ran into this bug.

It turns out it's very important to turn of mousemoved messages when you hide (orderOut:) a window. If you don't, it will actually still get these messages after it's hidden!

And when you show it again, other windows' tracking rects will be in the way, so all hell will break loose.

The reason it didn't happen for contextmenus, is because those windows are always recreated from scratch. If that is a bug, let's file it as a spin-off.
Assignee: joshmoz → hwaara
Status: NEW → ASSIGNED
Attachment #245559 - Flags: review?(joshmoz)
Hm, I think I'll need to turn on/off mouseMoved messages for sheets too. Just need to find the right places to hook in.
Attached patch Fix v2Splinter Review
This one includes sheets. I tested with the "Add bookmarks" sheet, and it now changes its cursor to caret when I move over the textfield (it didn't with the previous patch).

I'm basically just pairing every call to show/hide a window (in nsCocoaWindow::Show()) to turning on/off mousemoved messages.
Attachment #245559 - Attachment is obsolete: true
Attachment #245561 - Flags: review?(joshmoz)
Attachment #245559 - Flags: review?(joshmoz)
Attachment #245561 - Flags: superreview?(mikepinkerton)
Attachment #245561 - Flags: review?(joshmoz)
Attachment #245561 - Flags: review+
Attachment #245561 - Flags: superreview?(mikepinkerton) → superreview?(pavlov)
Comment on attachment 245561 [details] [diff] [review]
Fix v2

You have sr from pav, he just doesn't have his laptop here to mark it himself.
Attachment #245561 - Flags: superreview?(pavlov)
Attachment #245561 - Flags: superreview+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Depends on: 371405
This appears to have caused bug 371405.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: