forked from mirrors/gecko-dev
Bug 1823350 - Unify how we identify PiP windows on Linux/Windows. r=mconley,stransky
Also explicitly use titlebar=no on the PIP window, since we really don't want a titlebar. This way we don't end up without titlebars in other alwaysontop windows. Differential Revision: https://phabricator.services.mozilla.com/D172992
This commit is contained in:
parent
b8a3f6aaf8
commit
6eec2e9f70
2 changed files with 5 additions and 21 deletions
|
|
@ -18,12 +18,8 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
import { Rect, Point } from "resource://gre/modules/Geometry.sys.mjs";
|
import { Rect, Point } from "resource://gre/modules/Geometry.sys.mjs";
|
||||||
|
|
||||||
const PLAYER_URI = "chrome://global/content/pictureinpicture/player.xhtml";
|
const PLAYER_URI = "chrome://global/content/pictureinpicture/player.xhtml";
|
||||||
var PLAYER_FEATURES =
|
const PLAYER_FEATURES =
|
||||||
"chrome,titlebar=yes,alwaysontop,lockaspectratio,resizable";
|
"chrome,titlebar=no,alwaysontop,lockaspectratio,resizable,dialog";
|
||||||
/* Don't use dialog on Gtk as it adds extra border and titlebar to PIP window */
|
|
||||||
if (!AppConstants.MOZ_WIDGET_GTK) {
|
|
||||||
PLAYER_FEATURES += ",dialog";
|
|
||||||
}
|
|
||||||
const WINDOW_TYPE = "Toolkit:PictureInPicture";
|
const WINDOW_TYPE = "Toolkit:PictureInPicture";
|
||||||
const PIP_ENABLED_PREF = "media.videocontrols.picture-in-picture.enabled";
|
const PIP_ENABLED_PREF = "media.videocontrols.picture-in-picture.enabled";
|
||||||
const TOGGLE_ENABLED_PREF =
|
const TOGGLE_ENABLED_PREF =
|
||||||
|
|
|
||||||
|
|
@ -579,8 +579,8 @@ nsresult nsAppShellService::JustCreateTopWindow(
|
||||||
if (aChromeMask & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW)
|
if (aChromeMask & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW)
|
||||||
widgetInitData.mHasRemoteContent = true;
|
widgetInitData.mHasRemoteContent = true;
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GTK
|
#if defined(MOZ_WIDGET_GTK) || defined(XP_WIN)
|
||||||
// Linux/Gtk PIP window support. It's Chrome Toplevel window, always on top
|
// Windows/Gtk PIP window support. It's Chrome dialog window, always on top
|
||||||
// and without any bar.
|
// and without any bar.
|
||||||
uint32_t pipMask = nsIWebBrowserChrome::CHROME_ALWAYS_ON_TOP |
|
uint32_t pipMask = nsIWebBrowserChrome::CHROME_ALWAYS_ON_TOP |
|
||||||
nsIWebBrowserChrome::CHROME_OPENAS_CHROME |
|
nsIWebBrowserChrome::CHROME_OPENAS_CHROME |
|
||||||
|
|
@ -588,19 +588,7 @@ nsresult nsAppShellService::JustCreateTopWindow(
|
||||||
uint32_t barMask = nsIWebBrowserChrome::CHROME_MENUBAR |
|
uint32_t barMask = nsIWebBrowserChrome::CHROME_MENUBAR |
|
||||||
nsIWebBrowserChrome::CHROME_TOOLBAR |
|
nsIWebBrowserChrome::CHROME_TOOLBAR |
|
||||||
nsIWebBrowserChrome::CHROME_LOCATIONBAR |
|
nsIWebBrowserChrome::CHROME_LOCATIONBAR |
|
||||||
nsIWebBrowserChrome::CHROME_STATUSBAR;
|
nsIWebBrowserChrome::CHROME_TITLEBAR |
|
||||||
if (widgetInitData.mWindowType == widget::WindowType::TopLevel &&
|
|
||||||
((aChromeMask & pipMask) == pipMask) && !(aChromeMask & barMask)) {
|
|
||||||
widgetInitData.mPIPWindow = true;
|
|
||||||
}
|
|
||||||
#elif defined(XP_WIN)
|
|
||||||
// Windows PIP window support. It's Chrome dialog window, always on top
|
|
||||||
// and without any bar.
|
|
||||||
uint32_t pipMask = nsIWebBrowserChrome::CHROME_ALWAYS_ON_TOP |
|
|
||||||
nsIWebBrowserChrome::CHROME_OPENAS_CHROME;
|
|
||||||
uint32_t barMask = nsIWebBrowserChrome::CHROME_MENUBAR |
|
|
||||||
nsIWebBrowserChrome::CHROME_TOOLBAR |
|
|
||||||
nsIWebBrowserChrome::CHROME_LOCATIONBAR |
|
|
||||||
nsIWebBrowserChrome::CHROME_STATUSBAR;
|
nsIWebBrowserChrome::CHROME_STATUSBAR;
|
||||||
if (widgetInitData.mWindowType == widget::WindowType::Dialog &&
|
if (widgetInitData.mWindowType == widget::WindowType::Dialog &&
|
||||||
((aChromeMask & pipMask) == pipMask) && !(aChromeMask & barMask)) {
|
((aChromeMask & pipMask) == pipMask) && !(aChromeMask & barMask)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue