Cocoa widgets do not sent NS_MOUSE_ENTER/NS_MOUSE_EXIT events

RESOLVED FIXED

Status

()

RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: jaas, Assigned: jaas)

Tracking

Trunk
PowerPC
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 4 obsolete attachments)

(Assignee)

Description

13 years ago
Cocoa widgets do not sent NS_MOUSE_ENTER/NS_MOUSE_EXIT events.
(Assignee)

Comment 1

13 years ago
Created attachment 215904 [details] [diff] [review]
fix v1.0

Comment 2

13 years ago
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.
(Assignee)

Comment 3

13 years ago
Created attachment 215987 [details] [diff] [review]
fix v2.0

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
(Assignee)

Comment 4

13 years ago
Created attachment 216038 [details] [diff] [review]
fix v2.1

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)
(Assignee)

Updated

13 years ago
Blocks: 326469
(Assignee)

Comment 5

13 years ago
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)
(Assignee)

Comment 6

13 years ago
Created attachment 216102 [details] [diff] [review]
nsChildView cleanup, v1.0

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)
(Assignee)

Updated

13 years ago
Attachment #216038 - Flags: review?(mark)
(Assignee)

Comment 7

13 years ago
Created attachment 216103 [details] [diff] [review]
nsChildView cleanup, v1.1

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 8

13 years ago
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?

Comment 9

13 years ago
*** Bug 330594 has been marked as a duplicate of this bug. ***

Comment 10

13 years ago
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 11

13 years ago
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 12

13 years ago
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.
(Assignee)

Comment 13

13 years ago
Created attachment 216653 [details] [diff] [review]
fix v2.2

Fix another edge case Mark caught, cleanup. This was checked in.
Attachment #216038 - Attachment is obsolete: true
(Assignee)

Updated

13 years ago
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
(Assignee)

Comment 14

13 years ago
"nsChildView cleanup, v1.1" was also landed
(Assignee)

Comment 15

13 years ago
landed followup to set sLastViewEntered to nil when sLastViewEntered gets released/destroyed
Duplicate of this bug: 374926
You need to log in before you can comment on or make changes to this bug.