diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 56289e62ec6a..03b7c07d90d9 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -838,6 +838,15 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent, DWORD style = WindowStyle(); DWORD extendedStyle = WindowExStyle(); + // When window is PiP window on Windows7, WS_EX_COMPOSITED is set to suppress + // flickering during resizing with hardware acceleration. + bool isPIPWindow = aInitData && aInitData->mPIPWindow; + if (isPIPWindow && !IsWin8OrLater() && + gfxConfig::IsEnabled(gfx::Feature::HW_COMPOSITING) && + WidgetTypeSupportsAcceleration()) { + extendedStyle |= WS_EX_COMPOSITED; + } + if (mWindowType == eWindowType_popup) { if (!aParent) { parent = nullptr; diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp index 719684ceb072..68ea2fa9dd64 100644 --- a/xpfe/appshell/nsAppShellService.cpp +++ b/xpfe/appshell/nsAppShellService.cpp @@ -608,6 +608,19 @@ nsresult nsAppShellService::JustCreateTopWindow( ((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; + if (widgetInitData.mWindowType == eWindowType_dialog && + ((aChromeMask & pipMask) == pipMask) && !(aChromeMask & barMask)) { + widgetInitData.mPIPWindow = true; + } #endif #ifdef XP_MACOSX