This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ struct nsWidgetInitData {
111111 mSupportTranslucency(false ),
112112 mMouseTransparent(false ),
113113 mHasRemoteContent(false ),
114- mAlwaysOnTop(false ) {}
114+ mAlwaysOnTop(false ),
115+ mPIPWindow(false ) {}
115116
116117 nsWindowType mWindowType ;
117118 nsBorderStyle mBorderStyle ;
@@ -137,6 +138,8 @@ struct nsWidgetInitData {
137138 bool mMouseTransparent ;
138139 bool mHasRemoteContent ;
139140 bool mAlwaysOnTop ;
141+ // Is PictureInPicture window
142+ bool mPIPWindow ;
140143};
141144
142145#endif // nsWidgetInitData_h__
Original file line number Diff line number Diff line change @@ -624,6 +624,21 @@ nsresult nsAppShellService::JustCreateTopWindow(
624624 if (aChromeMask & nsIWebBrowserChrome::CHROME_ALWAYS_ON_TOP )
625625 widgetInitData.mAlwaysOnTop = true ;
626626
627+ #ifdef MOZ_WIDGET_GTK
628+ // Linux/Gtk PIP window support. It's Chrome Toplevel window, always on top
629+ // and without any bar.
630+ uint32_t pipMask = nsIWebBrowserChrome::CHROME_ALWAYS_ON_TOP |
631+ nsIWebBrowserChrome::CHROME_OPENAS_CHROME ;
632+ uint32_t barMask = nsIWebBrowserChrome::CHROME_MENUBAR |
633+ nsIWebBrowserChrome::CHROME_TOOLBAR |
634+ nsIWebBrowserChrome::CHROME_LOCATIONBAR |
635+ nsIWebBrowserChrome::CHROME_STATUSBAR ;
636+ if (widgetInitData.mWindowType == eWindowType_toplevel &&
637+ ((aChromeMask & pipMask) == pipMask) && !(aChromeMask & barMask)) {
638+ widgetInitData.mPIPWindow = true ;
639+ }
640+ #endif
641+
627642#ifdef XP_MACOSX
628643 // Mac OS X sheet support
629644 // Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from
You can’t perform that action at this time.
0 commit comments