Open Bug 1886781 Opened 1 year ago Updated 1 year ago

favor non-fullscreen windows when opening new tabs

Categories

(Firefox :: General, enhancement)

enhancement

Tracking

()

People

(Reporter: anarcat+register, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

My videoconferencing setup involves multiple monitors, where one monitor (say the left monitor) shows the videoconference, and then the other monitor is my work area. If I do a screenshare, I only share the right monitor which allows me to avoid recursion and have private stuff on the right.

To keep my display from going to sleep / locking, I put the left, videoconferencing window in full screen. On the right, I have terminals, editors, and, of course, often my main Firefox window with dozens of tabs open.

Actual results:

When I middle-click on links in that window (or open links from the outside with firefox example.com), tabs often end up in the videoconferencing window, on the left, instead of my main firefox window, on the right.

This is particularly confusing because the tabs are completely invisible in the UI: we don't see the tab bar in full screen (good).

Expected results:

I think Firefox, when opening new tabs, should first look for a window that's not in full screen mode.

A workaround for this is to turn the window in a "pop up". I've so far used the popup window extensions for this, but it's kind of clunky and confusing (and triggers crashes in my compository and/or Firefox, whee)...

I forgot to mention that my particular use case is just one specific example of a broader usability problem in full screen: I think improving this for all users could be a good thing. I'm not sure it should be the default because it could be confusing for tabs to open elsewhere like this, but maybe it could be hidden behind a pref?

Of course, one thing I don't think we should do is pop up a completely new window if we try to open a new tab in a full screen: if we already have only one window, it makes sense to keep things that way.

Oh, and I must mention I looked into the source tree for this, and this chunk here:

https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#6069-6075

    // try the current window.  if we're in a popup, fall back on the most recent browser window
    if (window.toolbar.visible) {
      win = window;
    } else {
      win = BrowserWindowTracker.getTopWindow({ private: aIsPrivate });
      needToFocusWin = true;
    }

.... looks pretty promising to me: maybe that toolbar.visible could be tweaked to also check for full screen? the trick then is to make sure it finds another window there, but I stopped digging down in here...

ugh... sorry for the multiple comments here, but another thing I just remembered... One problem with popup mode is that the screensharing menu fails to pop up properly in that mode, so you need to "un-pop up" if you need to share your screen, which is really clunky.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Version: other → unspecified

Emilio, any idea here? Shall we better check where to open new content?
Thanks.

Flags: needinfo?(emilio)

Perhaps? Though that's definitely not Widget: Gtk territory.

Permalink for the code linked in comment 2: https://searchfox.org/mozilla-central/rev/d7c5387a43bda5163afcb9e65e17c476c6ecf625/browser/base/content/browser.js#5803-5809

It might be worth considering if we need to distinguish DOM fullscreen (so, a fullscreen youtube video or anything like that) vs Firefox fullscreen. My guess is that we only want to consider the former?

Re. comment 0:

When I middle-click on links in that window

Just to confirm, "that window" is the fullscreen window, right? Or do middle-clicks on a regular window open tabs in another window? That sounds wrong and (more) unexpected.

Status: UNCONFIRMED → NEW
Component: Widget: Gtk → General
Ever confirmed: true
Flags: needinfo?(emilio) → needinfo?(anarcat+register)
Product: Core → Firefox

It might be worth considering if we need to distinguish DOM fullscreen (so, a fullscreen youtube video or anything like that) vs Firefox fullscreen. My guess is that we only want to consider the former?

The former, yes, full screen firefox shows the tab UI so that's not a problem.

When I middle-click on links in that window

Just to confirm, "that window" is the fullscreen window, right? Or do middle-clicks on a regular window open tabs in another window? That sounds wrong and (more) unexpected.

Right. Middle clicks on a regular window (or the full screen window) open tabs in the same window. What I would like is for middle clicks on a full screen window to open in another window, but obviously not other middle clicks...

Flags: needinfo?(anarcat+register)
You need to log in before you can comment on or make changes to this bug.