[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: prevent using `CompositorDirectComposition` with the legacy swapchain model

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Apr 29 15:59:13 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
42dfde00 by Fatih Uzunoglu at 2026-04-29T15:36:01+00:00
qt: prevent using `CompositorDirectComposition` with the legacy swapchain model

- - - - -
c2d9e1c0 by Fatih Uzunoglu at 2026-04-29T15:36:01+00:00
qt: simplify logic when deciding on disabling redirection surface in `CompositorDirectComposition`

We do not need to check this, since `CompositorDirectComposition`
is not available with the legacy swap chain model. This is because
Qt does not use Direct Composition with the legacy swap chain model.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -169,6 +169,12 @@ bool CompositorDirectComposition::init()
         graphicsApi != QSGRendererInterface::Direct3D12)
         return false;
 
+    if (Q_UNLIKELY(qEnvironmentVariableIntValue("QT_D3D_NO_FLIP")))
+    {
+        // Qt does not use Direct Composition with the legacy swapchain model.
+        return false;
+    }
+
     return true;
 }
 
@@ -280,22 +286,15 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx, std::funct
         //   does not have anything in the window to clear, so clear color can be transparent which means that the UI can be transparent and expose the window
         //   for the window to provide the (native) backdrop acrylic effect.
 
-        // WS_EX_NOREDIRECTIONBITMAP is only compatible with the flip swapchain model and D3D backend.
-        // In CompositorDirectComposition::init(), we already ensure that D3D is used (no OpenGL or Vulkan).
-        // Flip model is supported since Windows 8 and Qt does not use it only if the following environment
-        // variable is set. Since it targets Windows 10+, it does *not* check if flip model is supported and
-        // use the legacy swapchain model. For D3D12, flip model is always used.
-        const bool legacySwapchainModelIsExplicitlyWanted = qEnvironmentVariableIntValue("QT_D3D_NO_FLIP");
-
         const char* const envDisableRedirectionSurface = "QT_QPA_DISABLE_REDIRECTION_SURFACE";
         const bool redirectionSurfaceIsExplicitlyWanted = !qEnvironmentVariableIsEmpty(envDisableRedirectionSurface) && !qEnvironmentVariableIntValue(envDisableRedirectionSurface);
 
-        if (!legacySwapchainModelIsExplicitlyWanted && !redirectionSurfaceIsExplicitlyWanted)
+        if (!redirectionSurfaceIsExplicitlyWanted)
             qputenv(envDisableRedirectionSurface, "1"); // TODO: Other QQuickWindow (toolbar editor, independent popups)
 
         m_quickView->create();
 
-        if (!legacySwapchainModelIsExplicitlyWanted && !redirectionSurfaceIsExplicitlyWanted)
+        if (!redirectionSurfaceIsExplicitlyWanted)
             qunsetenv(envDisableRedirectionSurface); // NOTE: We need to disable it, otherwise regular QWidget windows would have issues
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4a89f9b66d483237fb6ab04127acce129edaf2fc...c2d9e1c0f3fc12d1a5b71ec0e3d2bbba16e2a416

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/4a89f9b66d483237fb6ab04127acce129edaf2fc...c2d9e1c0f3fc12d1a5b71ec0e3d2bbba16e2a416
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list