Closed Bug 329810 Opened 18 years ago Closed 18 years ago

middle click on a link does not work in Camino trunk builds

Categories

(Camino Graveyard :: Tabbed Browsing, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sugar.waffle, Assigned: mikepinkerton)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file)

There is no problem in Firefox.

In trunk NB 2006030800, middle click does not work on a link(<a></a>).

Reproducible: Always

Mac OS X 10.3.9
2006030800 (v1.2+)
Also reported here:

http://forums.mozillazine.org/viewtopic.php?t=390905

Last couple of days, maybe?

cl
This works for me with the 2006030600 (1.2+) build
but not anymore with the 2006030800 (1.2+) build.
Confirming based on phillipe's comment, and based on that, the window is http://tinyurl.com/lbn98

That's pretty big and there are a lot of bugs there; someone with a middle-mouse button testing the 07 March trunk build would help narrow that down.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
(In reply to comment #4)

> That's pretty big and there are a lot of bugs there; someone with a
> middle-mouse button testing the 07 March trunk build would help narrow that
> down.
> 

I had problems downloading that one, mirror was hopelessly slow.
2006030700 (1.2+) works for me.
(all this on 10.4.5)
2006030708 - own build
on 10.4.5+ works
New window: http://tinyurl.com/hz3v3

Of those bugs, bug 234455 seems the most likely to have touched this sort of thing.
Summary: trunk NB 2006030800: middle click does not work on a link. → middle click on a link does not work in Camino trunk builds
It's interesting that it works in firefox.  It makes me somehow vaguely suspect our embedding code that hooks up to this event.
It's probably that event patch...  I've commented on that bug.
This is probably a regression from bug 234455 but I don't have a mac, so I can't
really test.
Could someone point me the place where Camino's middle click handling
is implemented (that is apparently somehow different comparing to FF's 
middle click handling).
(In reply to comment #10)
> This is probably a regression from bug 234455 but I don't have a mac, so I
> can't
> really test.
> Could someone point me the place where Camino's middle click handling
> is implemented (that is apparently somehow different comparing to FF's 
> middle click handling).

See http://lxr.mozilla.org/mozilla/source/camino/src/embedding/ 

CHClickListener is what you want to look at.
Didn't find anything yet, but this sounds like some event listener is registered
either to wrong phase (capture/bubble) or wrong group (default/system).
It is also true that the order in which event handlers/default handling is
processed may have changed in some cases. I'll look at this later
today (unless someone who knows that Mac code finds the problem first ;) )

Blocks: 234455
Sorry, the code you want to look at is http://lxr.mozilla.org/mozilla/source/camino/src/browser/ContentClickListener.mm

We register one such listener here: http://lxr.mozilla.org/mozilla/source/camino/src/browser/BrowserWrapper.mm#343

If I set a breakpoint in ContentClickListener::MouseDown(), then it's getting called for normal mousedowns but simply not for middle-clicks.
Hmm, I did change CheckForAndDispatchClick.
The handling of NS_EVENT_FLAG_NO_CONTENT_DISPATCH has changed...
http://lxr.mozilla.org/seamonkey/source/content/events/src/nsEventStateManager.cpp#2986

I wonder if setting nglayout.events.dispatchLeftClickOnly to false makes any 
difference. But I'm still just guessing, I'll try to find out the real
reason for this bug later today.
Hmm, now I see. There is probably aVisitor.mForceContentDispatch = PR_TRUE; 
missing either in nsGlobalWindow::PreHandleEvent
or nsWindowRoot::PreHandleChromeEvent, or actually from both places.
If someone could test whether that helps here, that'd be great.
So add aVisitor.mForceContentDispatch = PR_TRUE;
after aVisitor.mCanHandle = PR_TRUE; in those methods.

(And remove nglayout.events.dispatchLeftClickOnly false, if you already set that ;))
This is probably related to bug 329119
Blocks: 329119
(In reply to comment #15)
> Hmm, now I see. There is probably aVisitor.mForceContentDispatch = PR_TRUE; 
> missing either in nsGlobalWindow::PreHandleEvent
> or nsWindowRoot::PreHandleChromeEvent, or actually from both places.
> If someone could test whether that helps here, that'd be great.
> So add aVisitor.mForceContentDispatch = PR_TRUE;
> after aVisitor.mCanHandle = PR_TRUE; in those methods.

Yes, this change seems to fix it!
Attached patch proposed patchSplinter Review
NS_EVENT_FLAG_NO_CONTENT_DISPATCH wasn't used in nsWindowRoot nor in 
nsGlobalWindow before 234455, so this is just putting back that functionality.
And according to Håkan this fixes the bug :)
Attachment #214586 - Flags: superreview?(bzbarsky)
Attachment #214586 - Flags: review?(bzbarsky)
Attachment #214586 - Flags: superreview?(bzbarsky)
Attachment #214586 - Flags: superreview+
Attachment #214586 - Flags: review?(bzbarsky)
Attachment #214586 - Flags: review+
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: