Closed Bug 510919 Opened 15 years ago Closed 15 years ago

Cursor can fail to change shape loading a new page (OS X)

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: smichaud, Assigned: smichaud)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

This bug is spun off from bug 504450, particularly from bug 504450
comment #20 and bug 504450 comment #32.  As best I can tell this bug
isn't a focus bug, and is unrelated to bug 504450 (see the STR in bug
504450 comment #0).

Furthermore, this bug (unlike bug 504450) is at least partially
cross-platform (I've seen something like it on both OS X and Windows,
though with different regression ranges).  It happens on
mozilla-central and the 1.9.2 branch, but not elsewhere.

STR:

1) Click on a link to this bug's URL
   (http://www.coteindustries.com/articles/html_articles/tabindex.html).

   Be careful not to move the mouse as you click on the link.  If you
   move it enough to change it to a pointer before the new page has
   finished loading, the bug doesn't happen.

2) A new page will load, but the mouse cursor will fail to change from
   a hand cursor back to a pointer.  This happens on both OS X and
   Windows.

   On Windows the mouse cursor changes to a pointer as soon as you
   move the mouse.  But on OS X the mouse cursor stays a hand cursor
   until you click somewhere in the page (this last may be caused by
   an additional, OS-X-specific bug).

The regression range for this bug is as follows on OS X:

firefox-2009-07-21-03-mozilla-central
firefox-2009-07-22-03-mozilla-central

And as follows on Windows:

firefox-2009-03-05-04-mozilla-central
firefox-2009-03-06-04-mozilla-central

After lunch I'll test on Linux.  For now I can't make anything of
these two regression ranges.
> =>  Bug 481359?

I assume you're suggesting this (on Windows) may be a regression
caused by (or triggered by) Markus' patch for bug 481359.  Sounds
reasonable to me.

Markus, what do you think?

From looking at your patch, I'd guess it just uncovered this bug (at
least on Windows), and didn't cause it.
As best I can tell this bug doesn't happen on Linux.
Depends on: 481359
(Following up comment #0)

> [This bug] happens on mozilla-central and the 1.9.2 branch, but not
> elsewhere.

On Windows in also happens on the 1.9.1 branch (in FF 3.5.X).
I think bug 445567 is the most likely cause (that's me again).
Blocks: 445567
Steven, does removing the code that was added in bug 325558 fix this bug?
Attached patch v1 (obsolete) — Splinter Review
Does this fix it? And maybe bug 496601, too, without regressing bug 325558?
Attachment #394905 - Flags: review?(smichaud)
Attachment #394905 - Attachment is obsolete: true
Attachment #394905 - Flags: review?(smichaud)
Comment on attachment 394905 [details] [diff] [review]
v1

Er, wait, I need to make this compile first
Attached patch v1 (obsolete) — Splinter Review
Attachment #394907 - Flags: review?(smichaud)
(In reply to comment #5)

> I think bug 445567 is the most likely cause (that's me again).

Yes, it is -- backing it out fixes this bug (on OS X 10.5.8 at least).

Which astonishes me.  I didn't think we were using cursor rects for
*anything*.  Some kind of Apple wierdness, I suppose.

It's entirely possible, though, that the patch for bug 445567 (in
addition to some later change during the regression window) only
*triggered* this bug.
(In reply to comment #6)

> Steven, does removing the code that was added in bug 325558 fix this bug?

Nope.  Makes no difference (at least on OS X 10.5.8).
Comment on attachment 394907 [details] [diff] [review]
v1

This patch doesn't fix the bug (at least on OS X 10.5.8).
Attachment #394907 - Flags: review?(smichaud) → review-
Blocks: 481359
No longer depends on: 481359
Does it fix bug 496601?
On OS X, this bug doesn't happen on OS X 10.4.11 -- only on OS X
10.5.X.  That, plus comment #10, strongly suggests that this bug (or
at least the trigger for this bug) is an Apple bug (having to do with
the different effects of [NSWindow disableCursorRects] on OS X 10.4.X
and 10.5.X).

Am I right, Markus, that your development system runs OS X 10.4.11
only (not 10.5.8)?  If so, maybe I should take this bug.
> If so, maybe I should take this bug.

Well, the OS X side of it.

I now suspect we're dealing with two different bugs (one on Windows and another on OS X), that are at best tangentially related.
Right, my development system only runs 10.4. It would be great if you could take this bug.
Assignee: nobody → smichaud
Status: NEW → ASSIGNED
Comment on attachment 394907 [details] [diff] [review]
v1

> Does it fix bug 496601?

Yes it does.

But I had to test on the 1.9.1 branch, since bug 496601 no longer
happens on the trunk or the 1.9.2 branch.
Thanks for testing! And of course bug 496601 is not reproducible on trunk, how could I miss that...
I'll move the patch there.
Attachment #394907 - Attachment is obsolete: true
Attached patch Fix for OS X bugSplinter Review
Here's a patch that fixes this bug (the OS X bug) without regressing
bug 445567.  It's *much* simpler than I feared it would be.

A tryserver build will follow in a few hours.

Once I understand the Windows-specific bug better, I'll spin that off
into a new bug.
Attachment #395083 - Flags: review?
I've spun the Windows-specific bug off into bug 511151.
Assignee: smichaud → nobody
No longer blocks: 445567
Component: General → Widget: Cocoa
QA Contact: general → cocoa
Summary: Cursor can fail to change shape loading a new page → Cursor can fail to change shape loading a new page (OS X)
Assignee: nobody → smichaud
OS: All → Mac OS X
Blocks: 445567
No longer blocks: 481359
Here's a tryserver build made with my patch from comment #19:
https://build.mozilla.org/tryserver-builds/smichaud@pobox.com-bugzilla510919/bugzilla510919-macosx.dmg

Please try it out, Stephen! :-)
(In reply to comment #21)
> Here's a tryserver build made with my patch from comment #19:
> https://build.mozilla.org/tryserver-builds/smichaud@pobox.com-bugzilla510919/bugzilla510919-macosx.dmg
> 
> Please try it out, Stephen! :-)

I can confirm that it fixes that bug (woot!); one thing that seems to have regressed, though, is that command+w fails to close that tab _without_ an explicit click on the page.
Nice Steven, the fix makes sense. But I'd like to understand what exactly is
going on - when the cursor update fails, is -[nsCursorManager setCursor:]
called at all? Does the call to -[NSCursor set] in -[nsCocoaCursor setFrame:]
just fail silently? If that's the case, what happens when you replace the
performSelectorOnMainThread: invocation with a direct call to set, like I do in
the (second) patch in bug 496601?
(In reply to comment #22)

> I can confirm that it fixes that bug (woot!);

Glad to hear it!

> one thing that seems to have regressed, though, is that command+w
> fails to close that tab _without_ an explicit click on the page.

I don't see this (either with or without my patch).  Try it in safe
mode (without extensions).
The second part of comment 22 only happens when I have two tabs open.  In the screencast that follows, opening up a new window is fine, but a new tab requires that explicit page click before command+W works.

http://screencast.com/t/MuUG2OvVWqca

I'll see if I can reproduce with Namoroka.
(In reply to comment #23)

I'm afraid I didn't look into it that far.  I was satisfied when I
found that (on OS X 10.5 and above) I could substitute calling [NSApp
disableCursorRects] once for calling [NSWindow disableCursorRects] on
every browser window.

Clearly this means that [NSApplication disableCursorRects] does
something more (where it's available) than just calling [NSWindow
disableCursorRects] on each window -- otherwise your patch for bug
445567 wouldn't have caused this regression.  I don't know what the
"something more" is, nor do I feel we need to know:  [NSApplication
disableCursorRects] seems to do what's needed, and it makes sense that
this is what an NSApplication method with that name would do.  It's
just too bad that Apple hasn't (yet) documented [NSApplication
disableCursorRects] -- it seems to be much more suitable to our
purposes (globally disabling cursor rects) than [NSWindow
disableCursorRects].
(In reply to comment #25)

Please give me step-by-step STR.  I can't figure out your webcast.

I also tested with two tabs.
(In reply to comment #27)
> (In reply to comment #25)
> 
> Please give me step-by-step STR.  I can't figure out your webcast.
> 
> I also tested with two tabs.

I reproduced this in Namoroka, so it's not a problem with your patch, but here are the STR:

1. Load https://bugzilla.mozilla.org/show_bug.cgi?id=510919
2. With the default tab prefs, click on the URL in bugzilla (http://www.coteindustries.com/articles/html_articles/tabindex.html), and then after it loads try command+w; without a subsequent, explicit click, you can't close that newly opened tab.
(In reply to comment #28)

Now I see it -- your were clicking on the URL link at the top of the
bug (which opens the site in a new tab and triggers the bug), while I
was clicking on the URL in comment #0 (which doesn't).

You don't (initially) need to have a second tab to see this bug.  It
happens in both Minefield and Namoroka (with or without my patch).
And it's a focus bug -- cmd-n and cmd-t also don't work.

Thanks, Stephen, for the STR.  I'll spin this off into a new bug.
I've spun off the STR from comment #28 into bug 511449.
Attachment #395083 - Flags: review? → review?(joshmoz)
Comment on attachment 395083 [details] [diff] [review]
Fix for OS X bug

review -> mstange, he's been looking into related things recently
Attachment #395083 - Flags: review?(joshmoz) → review?(mstange)
Steven, does this patch still work for you on 10.5? It doesn't fix the bug for me on 10.6.
When I tested my patch (from comment #19), it fixed the bug on both 10.5 and 10.6.

I'll test again tomorrow.  Possibly something else has changed in the meantime.
Comment on attachment 395083 [details] [diff] [review]
Fix for OS X bug

Canceling review for now - I don't see any evidence that this patch has any effect, neither on 10.5 nor on 10.6.
Attachment #395083 - Flags: review?(mstange)
Comment on attachment 395083 [details] [diff] [review]
Fix for OS X bug

> I don't see any evidence that this patch has any effect, neither on
> 10.5 nor on 10.6.

My patch still works fine on the 1.9.2 branch, on both OS X 10.5.8 and
10.6.1 (using today's code).  But it doesn't work (it appears to make
no difference) on the trunk (mozilla-central).

Back when it was first posted (2009-08-18), my patch worked fine even
on the trunk (on both 10.5 and 10.6).  Markus, can you think which
change (on the trunk) might have made this patch stop working?
> Markus, can you think which change (on the trunk) might have made
> this patch stop working?

My bet is on one of the patches for bug 496601.
> My bet is on one of the patches for bug 496601.

I was wrong.  Next most likely is the patch for bug 443178.
(In reply to comment #35)
> Markus, can you think which
> change (on the trunk) might have made this patch stop working?

Offhand, no. But I'd rather search for patches related to focus than related to mouse events or cursers.
> Next most likely is the patch for bug 443178.

It wasn't that patch, either.
If I recall correctly, this bug was fixed by bug 511449.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Depends on: 511449
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: