Closed Bug 331349 Opened 18 years ago Closed 18 years ago

Cocoa widgets do not sent NS_MOUSE_ENTER/NS_MOUSE_EXIT events

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

References

Details

Attachments

(2 files, 4 obsolete files)

Cocoa widgets do not sent NS_MOUSE_ENTER/NS_MOUSE_EXIT events.
Attached patch fix v1.0 (obsolete) — Splinter Review
Comment on attachment 215904 [details] [diff] [review]
fix v1.0

do the x/y coords need to be moved from bottom right to top left?  otherwise, seems fine to me.
Attached patch fix v2.0 (obsolete) — Splinter Review
Cocoa sends enter/exit events for all views in a hierarchy, Gecko wants enter/exit for only the top-level views. That makes things really fairly complicated, the logic in this patch is a bit of a brain twister.

This makes our behavior for NS_MOUSE_ENTER/EXIT match up with GTK2 and Windows. I'm going to test it a bit more tomorrow (I need to sleep!) before requesting review.

This patch also fixes 330594.
Attachment #215904 - Attachment is obsolete: true
Attached patch fix v2.1 (obsolete) — Splinter Review
This is the same as the last patch, but includes fixes in the debug code. If you want to test this patch, just uncomment the NSLog statements in the patch.
Attachment #215987 - Attachment is obsolete: true
Attachment #216038 - Flags: review?(mark)
Blocks: cocoa
Comment on attachment 216038 [details] [diff] [review]
fix v2.1

Dropping my review request - I want to investigate something I discovered.
Attachment #216038 - Flags: review?(mark)
Attached patch nsChildView cleanup, v1.0 (obsolete) — Splinter Review
When looking through nsChildView.mm, I saw some existing stuff about mouse enter/exit, also the tracking rect stuff. I was curious about what that was doing, so I cancelled my review request until I understood it. I understand it now, I cleaned it up in this patch and I'm requesting review on my "fix v2.1" patch again.

While I was looking around I found some unused/unnecessary variables. This patch removes them. We will no longer be supporting Mac OS X 10.2.x on the trunk, so I removed support for that from nsChildView as well. This is cleanup, I'd like to land it before the fix to this bug.
Attachment #216102 - Flags: review?(mark)
Attachment #216038 - Flags: review?(mark)
forgot to include some changes in the last patch
Attachment #216102 - Attachment is obsolete: true
Attachment #216103 - Flags: review?(mark)
Attachment #216102 - Flags: review?(mark)
Comment on attachment 216038 [details] [diff] [review]
fix v2.1

I've been looking at this code for a while now, to really understand.

Instead of re-using mouseEntered and mouseExited for the messy mouse event logic of parent/subviews, how about creating a mouseDidEnterSubview and  mouseDidExitSubview to handle those cases?
*** Bug 330594 has been marked as a duplicate of this bug. ***
Comment on attachment 216038 [details] [diff] [review]
fix v2.1

Nice work!

+static nsEventStatus sendMouseEvent(PRBool isTrusted, PRUint32 msg, nsIWidget *w, nsMouseEvent::reasonType aReason,
+                      NSPoint localEventLocation, nsChildView* receiver)

C/C++ functions should have a leading capital letter.
Attachment #216038 - Flags: review?(mark) → review+
Comment on attachment 216103 [details] [diff] [review]
nsChildView cleanup, v1.1

Thanks for separating the cleanup.  r=me on both.
Attachment #216103 - Flags: review?(mark) → review+
Comment on attachment 216038 [details] [diff] [review]
fix v2.1

r=me conditional on isDescendantOf: check or tests that show it's unneded, as discussed.
Attached patch fix v2.2Splinter Review
Fix another edge case Mark caught, cleanup. This was checked in.
Attachment #216038 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
"nsChildView cleanup, v1.1" was also landed
landed followup to set sLastViewEntered to nil when sLastViewEntered gets released/destroyed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: