Closed Bug 1875831 Opened 4 months ago Closed 2 months ago

Tab hover card changes window order

Categories

(Firefox :: Tabbed Browser, defect)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
125 Branch
Tracking Status
firefox125 --- disabled
firefox126 --- verified

People

(Reporter: julianwels, Assigned: mossop)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Attached video demo.mp4

Hello!

STR:

  1. In Nightly on macOS set browser.tabs.cardPreview.enabled to true
  2. Open two windows and position them in a way that they overlap and the tab strip of the partially covered window is still visible
  3. On the window that is covered by the other, hover over a tab until the tab preview appears.
    (the video makes it a lot clearer I think)

Expected result:
The tab preview appears, but the window is still covered by the other window.

Actual result:
The window where the tab preview shows up is being moved on top of all others.

Blocks: 1783521
OS: Unspecified → macOS
Hardware: Unspecified → Desktop
Blocks: 1848157

If you apply the patch in bug 1875143, is this still reproducible?

Flags: needinfo?(julianwels)
Severity: -- → S3
Depends on: 1875553
OS: macOS → All
Summary: Tab hover card changes window order on macOS → Tab hover card changes window order

Just tested myself. Yes, it's still reproducible with 1875143 applied.

Flags: needinfo?(julianwels)

Bug 1875553 offers a potential solution, which is not to show the tabpreview for backgrounded windows.

Yeah, I can still reproduce it with that patch applied :(
Sorry

Edit: oops, sorry did not see you already tested

For me the preview seems to steal focus from any other application window, not just Firefox windows.

Duplicate of this bug: 1877978

(In reply to Paul Zühlcke [:pbz] from comment #5)

For me the preview seems to steal focus from any other application window, not just Firefox windows.

Yes me too, I'm probably going to disable the feature for the time being because its so annoying.

Is S3 accurate if people end up using about:config to disable the feature? It feels like something that'd block shipping this.

Flags: needinfo?(dao+bmo)

The panel isn't an arrow panel and the standard popup positioning appears to
work fine. It also seems that something about the arrow positioning logic
causes background windows to raise.

Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a5f3b98b5997
Don't use arrow positioning for the tab preview panel. r=tabbrowser-reviewers,dao
No longer blocks: 1881488

Backed out for causing mochitests failures in browser_tab_preview.js

Flags: needinfo?(dtownsend)
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1887aa693fdc
Don't use arrow positioning for the tab preview panel. r=tabbrowser-reviewers,dao
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch

I used the build from treeherder that has the fix and I can see that its not fixed completely. If using the steps from comment 0 it reproduces instantly when hovering over one tab from background but if you use the interaction between Firefox and another program (Firefox in background and your focus in another program), one must hover over the tabs in Firefox a couple of times until the focus jumps to Firefox (this is kind of intermittently reproducible). I tried this with a trackpad and mouse on MacOS 13 and macOS 14.
Reopening the bug based on the above.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Flags: needinfo?(dtownsend)

I've narrowed the problem down to this call to orderFront. It appears to be being called on the popup but it brings the main window to the front, presumably because it is a parent of the popup or something? I'm not really sure if the call is needed, commenting it out doesn't appear to break popups in any way that I can see.

Markus, do you know what this orderFront call is meant to be for or if we could maybe skip it in this case somehow?

Flags: needinfo?(mstange.moz)

(In reply to Dave Townsend [:mossop] from comment #15)

I've narrowed the problem down to this call to orderFront. It appears to be being called on the popup but it brings the main window to the front, presumably because it is a parent of the popup or something?

That sounds likely - specifically the parent window part.

Which exact call to orderFront are you referring to?

Also, does this have to be a panel or could it be a position:fixed element inside the main browser window? In Chrome the tab tooltip never extends beyond the main window's bounds, so I don't think it would need to extend beyond the browser window in Firefox.

Flags: needinfo?(mstange.moz) → needinfo?(dtownsend)

(In reply to Markus Stange [:mstange] from comment #16)

(In reply to Dave Townsend [:mossop] from comment #15)

I've narrowed the problem down to this call to orderFront. It appears to be being called on the popup but it brings the main window to the front, presumably because it is a parent of the popup or something?

That sounds likely - specifically the parent window part.

Which exact call to orderFront are you referring to?

Sorry, meant to link to that: https://searchfox.org/mozilla-central/source/widget/cocoa/nsCocoaWindow.mm#942

Also, does this have to be a panel or could it be a position:fixed element inside the main browser window? In Chrome the tab tooltip never extends beyond the main window's bounds, so I don't think it would need to extend beyond the browser window in Firefox.

I'm not sure.

Flags: needinfo?(dtownsend) → needinfo?(mstange.moz)

(In reply to Markus Stange [:mstange] from comment #16)

Also, does this have to be a panel or could it be a position:fixed element inside the main browser window? In Chrome the tab tooltip never extends beyond the main window's bounds, so I don't think it would need to extend beyond the browser window in Firefox.

There was some discussion in the revision comments that moved us away from that. In short there were some alignment and layering problems with the UI that are probably fixable, but using a panel made them irrelevant. Since this is a dialog-like element, I think it ideally it should remain as a panel.

Severity: S3 → S2
Flags: needinfo?(dao+bmo)

(In reply to Dave Townsend [:mossop] from comment #15)

I've narrowed the problem down to this call to orderFront. It appears to be being called on the popup but it brings the main window to the front, presumably because it is a parent of the popup or something? I'm not really sure if the call is needed, commenting it out doesn't appear to break popups in any way that I can see.

Sorry I haven't yet had a chance to debug this. But in theory I would expect that you need at least one call to orderFront so that the window becomes visible at all. It's possible that we can skip subsequent orderFront calls if we know that the window is already visible. If removing that call doesn't break anything, then the next step would be to find out which orderFront call makes the window visible to begin with, and then think about whether that's enough.

Flags: needinfo?(mstange.moz)

Currently for popup windows with a parent window call orderFront and
addChildWindow, both of which set the popups window level. It appears that
we only need one of these for the popup to appear correctly, using both for
some reason has the side effect of also raising the parent window above all
other application windows. This patch skips the orderFront call when we are
also going to call addChildWindow.

Also removed the now redundant comment about _setWindowNumber.

Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87de8d00268a
Only use one method to order popup windows. r=spohl
Status: REOPENED → RESOLVED
Closed: 3 months ago2 months ago
Resolution: --- → FIXED

I am unable to reproduce this anymore with the latest Nightly 126.0a1 on my macOS 13 macbook, closing as verified fixed.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: