[vlc-commits] [Git][videolan/vlc][master] qt: respect `qt-backdrop-blur` setting also intra-window

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jan 9 17:11:57 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7bf2597e by Fatih Uzunoglu at 2025-01-09T16:58:43+00:00
qt: respect `qt-backdrop-blur` setting also intra-window

I don't see a reason why `qt-backdrop-blur` should not be
respected for intra-window backdrop blur effect (Frosted
Glass Effect).

The said setting was first added to disable inter-window
backdrop blur, which is currently supported with the
following circumstances:

- KWin (Wayland and X11) and KWindowSystem is available.
- Windows 11 22H2 (native acrylic effect
  `DWMSBT_TRANSIENTWINDOW`).
- Windows 10/11 simulated acrylic effect (`compositor_
  dcomp_acrylicsurface.cpp`) when Direct Composition is
  used (`--qt-compositor=dcomp`).

We also have our own backdrop blur effect, currently
used for the mini player and the indexing progress
indicator.

I propose that if the user explicitly opt-outs from
backdrop blur by unsetting `qt-backdrop-blur` (it is
set by default), the application shall respect that
for intra-window backdrop blur effect.

- - - - -


2 changed files:

- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/maininterface/qml/MainDisplay.qml


Changes:

=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -270,6 +270,8 @@ public:
             return false; // Wayland is too buggy (tested with KWin 6.2), and there is no sign it'll improve by Qt 6.8.2 (QTBUG-131899).
         return true;
     }
+    
+    Q_INVOKABLE bool backdropBlurRequested() const { return var_InheritBool(p_intf, "qt-backdrop-blur"); }
 
     Q_INVOKABLE static inline void setCursor(Qt::CursorShape cursor) { QApplication::setOverrideCursor(QCursor(cursor)); }
     Q_INVOKABLE static inline void restoreCursor(void) { QApplication::restoreOverrideCursor(); }


=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -226,7 +226,8 @@ FocusScope {
 
                 color: theme.bg.primary
 
-                layer.enabled: (GraphicsInfo.shaderType === GraphicsInfo.RhiShader) &&
+                layer.enabled: MainCtx.backdropBlurRequested() &&
+                               (GraphicsInfo.shaderType === GraphicsInfo.RhiShader) &&
                                (miniPlayer.visible || (loaderProgress.active && loaderProgress.item.visible))
 
                 layer.effect: Widgets.PartialEffect {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7bf2597ed2bb39ef1997bbec3095882e3b0e9b50

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7bf2597ed2bb39ef1997bbec3095882e3b0e9b50
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list