[vlc-commits] [Git][videolan/vlc][master] 5 commits: qt: add kwindowsystem_module and win32windoweffects_module

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu May 9 16:37:11 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e6a1738d by Fatih Uzunoglu at 2024-05-09T16:05:51+00:00
qt: add kwindowsystem_module and win32windoweffects_module

- - - - -
10134a41 by Fatih Uzunoglu at 2024-05-09T16:05:51+00:00
qt: add setBlurBehind() to CompositorVideo

- - - - -
9fca2c36 by Fatih Uzunoglu at 2024-05-09T16:05:51+00:00
qt: use `CompositorVideo::setBlurBehind()` in compositor_dcomp

- - - - -
041b8f04 by Fatih Uzunoglu at 2024-05-09T16:05:51+00:00
qt: enable acrylic blur for KWin in compositor_wayland

- - - - -
7b98948b by Fatih Uzunoglu at 2024-05-09T16:05:51+00:00
qt: use KWindowSystem to enable blur in CompositorX11

- - - - -


16 changed files:

- configure.ac
- modules/gui/qt/Makefile.am
- modules/gui/qt/maininterface/compositor.cpp
- modules/gui/qt/maininterface/compositor.hpp
- modules/gui/qt/maininterface/compositor_dcomp.cpp
- modules/gui/qt/maininterface/compositor_dcomp.hpp
- modules/gui/qt/maininterface/compositor_wayland.cpp
- modules/gui/qt/maininterface/compositor_x11.cpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.hpp
- + modules/gui/qt/maininterface/kwindowsystem_module.cpp
- + modules/gui/qt/maininterface/win32windoweffects_module.cpp
- + modules/gui/qt/maininterface/win32windoweffects_module.hpp
- + modules/gui/qt/maininterface/windoweffects_module.hpp
- modules/gui/qt/meson.build
- modules/gui/qt/qt.cpp


Changes:

=====================================
configure.ac
=====================================
@@ -3944,6 +3944,16 @@ dnl
 
 EXTEND_HELP_STRING([Interface plugins:])
 
+dnl
+dnl  KF6WindowSystem
+dnl
+PKG_CHECK_MODULES([KF6WINDOWSYSTEM], [KF6WindowSystem >= 6.0.0], [
+  have_kf6windowsystem="yes"
+], [
+  have_kf6windowsystem="no"
+])
+AM_CONDITIONAL([HAVE_KF6WINDOWSYSTEM], [test "${have_kf6windowsystem}" = "yes"])
+
 dnl
 dnl QT
 dnl


=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -188,6 +188,7 @@ libqt_plugin_la_SOURCES = \
 	maininterface/videosurface.hpp \
 	maininterface/video_window_handler.cpp \
 	maininterface/video_window_handler.hpp \
+	maininterface/windoweffects_module.hpp \
 	medialibrary/medialib.cpp \
 	medialibrary/medialib.hpp \
 	medialibrary/mlalbum.cpp \
@@ -528,7 +529,9 @@ libqt_plugin_la_SOURCES += \
 	maininterface/mainctx_win32.hpp \
 	maininterface/compositor_win7.cpp \
 	maininterface/compositor_win7.hpp \
-	style/windowsthemeprovider.cpp
+	style/windowsthemeprovider.cpp \
+	maininterface/win32windoweffects_module.cpp \
+	maininterface/win32windoweffects_module.hpp
 
 nodist_libqt_plugin_la_SOURCES += maininterface/mainctx_win32.moc.cpp \
 	maininterface/compositor_win7.moc.cpp
@@ -614,6 +617,22 @@ endif
 endif
 endif
 
+if !HAVE_WIN32
+if HAVE_KF6WINDOWSYSTEM
+
+libqt_plugin_la_CPPFLAGS += -DQT_HAS_KWINDOWSYSTEM_PLUGIN
+
+libqt_kwindowsystem_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(KF6WINDOWSYSTEM_CFLAGS)
+libqt_kwindowsystem_plugin_la_LIBADD =  $(KF6WINDOWSYSTEM_LIBS)
+libqt_kwindowsystem_plugin_la_SOURCES = \
+	maininterface/kwindowsystem_module.cpp
+
+if ENABLE_QT
+gui_LTLIBRARIES += libqt_kwindowsystem_plugin.la
+endif
+endif
+endif
+
 # User interface compilation
 
 uic_verbose = $(uic_verbose_$(V))


=====================================
modules/gui/qt/maininterface/compositor.cpp
=====================================
@@ -40,7 +40,11 @@
 #  include "compositor_x11.hpp"
 #endif
 
+#include "maininterface/windoweffects_module.hpp"
+
 #include <vlc_window.h>
+#include <vlc_modules.h>
+
 
 using namespace vlc;
 
@@ -184,7 +188,12 @@ CompositorVideo::CompositorVideo(qt_intf_t *p_intf, QObject* parent)
 
 CompositorVideo::~CompositorVideo()
 {
-
+    if (m_windowEffectsModule)
+    {
+        if (m_windowEffectsModule->p_module)
+            module_unneed(m_windowEffectsModule, m_windowEffectsModule->p_module);
+        vlc_object_delete(m_windowEffectsModule);
+    }
 }
 
 void CompositorVideo::commonSetupVoutWindow(vlc_window_t* p_wnd, VoutDestroyCb destroyCb)
@@ -250,6 +259,7 @@ void CompositorVideo::commonWindowDisable()
 bool CompositorVideo::commonGUICreateImpl(QWindow* window, CompositorVideo::Flags flags)
 {
     assert(m_mainCtx);
+    assert(window);
 
     m_videoSurfaceProvider = std::make_unique<VideoSurfaceProvider>();
     m_mainCtx->setVideoSurfaceProvider(m_videoSurfaceProvider.get());
@@ -261,6 +271,10 @@ bool CompositorVideo::commonGUICreateImpl(QWindow* window, CompositorVideo::Flag
         connect(m_videoSurfaceProvider.get(), &VideoSurfaceProvider::surfaceSizeChanged,
                 this, &CompositorVideo::onSurfaceSizeChanged);
     }
+    if (flags & CompositorVideo::HAS_ACRYLIC)
+    {
+        setBlurBehind(window, true);
+    }
     m_videoWindowHandler = std::make_unique<VideoWindowHandler>(m_intf);
     m_videoWindowHandler->setWindow( window );
 
@@ -269,7 +283,7 @@ bool CompositorVideo::commonGUICreateImpl(QWindow* window, CompositorVideo::Flag
 #else
     m_interfaceWindowHandler = std::make_unique<InterfaceWindowHandler>(m_intf, m_mainCtx, window);
 #endif
-    m_mainCtx->setHasAcrylicSurface(flags & CompositorVideo::HAS_ACRYLIC);
+    m_mainCtx->setHasAcrylicSurface(m_blurBehind);
     m_mainCtx->setWindowSuportExtendedFrame(flags & CompositorVideo::HAS_EXTENDED_FRAME);
 
 #ifdef _WIN32
@@ -320,3 +334,39 @@ void CompositorVideo::commonIntfDestroy()
     m_videoSurfaceProvider.reset();
     unloadGUI();
 }
+
+bool CompositorVideo::setBlurBehind(QWindow *window, const bool enable)
+{
+    assert(window);
+    assert(m_intf);
+
+    if (m_failedToLoadWindowEffectsModule)
+        return false;
+
+    if (!m_windowEffectsModule)
+    {
+        m_windowEffectsModule = vlc_object_create<WindowEffectsModule>(m_intf);
+        if (!m_windowEffectsModule) // do not set m_failedToLoadWindowEffectsModule here
+            return false;
+    }
+
+    if (!m_windowEffectsModule->p_module)
+    {
+        m_windowEffectsModule->p_module = module_need(m_windowEffectsModule, "qtwindoweffects", nullptr, false);
+        if (!m_windowEffectsModule->p_module)
+        {
+            msg_Info(m_intf, "A module providing window effects capability could not be instantiated. Background blur effect will not be available.");
+            m_failedToLoadWindowEffectsModule = true;
+            vlc_object_delete(m_windowEffectsModule);
+            m_windowEffectsModule = nullptr;
+            return false;
+        }
+    }
+
+    if (!m_windowEffectsModule->isEffectAvailable(WindowEffectsModule::BlurBehind))
+        return false;
+
+    m_windowEffectsModule->setBlurBehind(window, enable);
+    m_blurBehind = enable;
+    return true;
+}


=====================================
modules/gui/qt/maininterface/compositor.hpp
=====================================
@@ -48,6 +48,7 @@ class QWindow;
 class QQuickItem;
 class QQuickView;
 class QQuickWindow;
+struct WindowEffectsModule;
 
 namespace vlc {
 
@@ -126,6 +127,8 @@ protected:
     void commonWindowEnable();
     void commonWindowDisable();
 
+    bool setBlurBehind(QWindow* window, bool enable = true);
+
 protected:
     bool commonGUICreate(QWindow* window, QmlUISurface* , CompositorVideo::Flags flags);
     bool commonGUICreate(QWindow* window, QQuickView* , CompositorVideo::Flags flags);
@@ -154,6 +157,10 @@ protected:
 #ifdef _WIN32
     std::unique_ptr<WinTaskbarWidget> m_taskbarWidget;
 #endif
+
+    bool m_blurBehind = false;
+    WindowEffectsModule* m_windowEffectsModule = nullptr;
+    bool m_failedToLoadWindowEffectsModule = false;
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(CompositorVideo::Flags)


=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -34,8 +34,6 @@
 #warning "QSystemLibrary private header is required for DirectComposition compositor."
 #endif
 
-#include <QOperatingSystemVersion>
-
 #include <QtGui/qpa/qplatformnativeinterface.h>
 #include <QtCore/private/qsystemlibrary_p.h>
 
@@ -62,8 +60,6 @@
 #include "compositor_dcomp_acrylicsurface.hpp"
 #include "maininterface/interface_window_handler.hpp"
 
-#include <dwmapi.h>
-
 namespace vlc {
 
 int CompositorDirectComposition::windowEnable(const vlc_window_cfg_t *)
@@ -201,7 +197,7 @@ void CompositorDirectComposition::setup()
 
     m_dcompDevice->Commit();
 
-    if (!m_nativeAcrylicAvailable)
+    if (!m_blurBehind)
     {
         try
         {
@@ -258,31 +254,11 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
                 eventLoop.quit();
         }, Qt::SingleShotConnection);
 
-    CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP;
-
-    // If Windows 11 Build 22621, enable acrylic effect:
-    m_nativeAcrylicAvailable = QOperatingSystemVersion::current()
-                                 >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 11, 0, 22621);
-    if (m_nativeAcrylicAvailable)
-    {
-        flags |= CompositorVideo::HAS_ACRYLIC;
-    }
-
-    const bool ret = commonGUICreate(quickViewPtr, quickViewPtr, flags);
+    CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP | CompositorVideo::HAS_ACRYLIC;
 
     m_quickView->create();
 
-    if (m_nativeAcrylicAvailable)
-    {
-        enum BackdropType
-        {
-            DWMSBT_TRANSIENTWINDOW = 3
-        } backdropType = DWMSBT_TRANSIENTWINDOW;
-        DwmSetWindowAttribute(reinterpret_cast<HWND>(m_quickView->winId()),
-                              38 /* DWMWA_SYSTEMBACKDROP_TYPE */,
-                              &backdropType,
-                              sizeof(backdropType));
-    }
+    const bool ret = commonGUICreate(quickViewPtr, quickViewPtr, flags);
 
     m_quickView->show();
 


=====================================
modules/gui/qt/maininterface/compositor_dcomp.hpp
=====================================
@@ -87,8 +87,6 @@ private:
     Microsoft::WRL::ComPtr<IDCompositionVisual> m_videoVisual;
     IDCompositionVisual *m_uiVisual = nullptr;
 
-    bool m_nativeAcrylicAvailable = false;
-
     QPointer<class CompositorDCompositionAcrylicSurface> m_acrylicSurface;
 };
 


=====================================
modules/gui/qt/maininterface/compositor_wayland.cpp
=====================================
@@ -119,7 +119,7 @@ bool CompositorWayland::makeMainInterface(MainCtx* mainCtx)
     m_waylandImpl->setupInterface(m_waylandImpl, interfaceSurface, dprForWindow(m_qmlView.get()));
 
     return commonGUICreate(m_qmlView.get(), m_qmlView.get(),
-                    CompositorVideo::CAN_SHOW_PIP);
+                    CompositorVideo::CAN_SHOW_PIP | CompositorVideo::HAS_ACRYLIC);
 }
 
 QWindow* CompositorWayland::interfaceMainWindow() const


=====================================
modules/gui/qt/maininterface/compositor_x11.cpp
=====================================
@@ -207,14 +207,15 @@ bool CompositorX11::makeMainInterface(MainCtx* mainCtx)
     m_qmlView->winId();
     m_qmlView->show();
 
-    CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP;
-    if (m_renderWindow->hasAcrylic())
-        flags |= CompositorVideo::HAS_ACRYLIC;
+    CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP | HAS_ACRYLIC;
     if (m_renderWindow->supportExtendedFrame())
         flags |= CompositorVideo::HAS_EXTENDED_FRAME;
     if (!commonGUICreate(m_renderWindow.get(), m_qmlView.get(), flags))
         return false;
 
+    if (m_blurBehind)
+        m_renderWindow->m_hasAcrylic = true;
+
     m_renderWindow->setInterfaceWindow(m_qmlView.get());
     m_renderWindow->setVideoWindow(m_videoWidget->windowHandle());
 


=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
=====================================
@@ -42,8 +42,6 @@
 #include "qt.hpp"
 #include "mainctx.hpp"
 
-//blur behind for KDE
-#define _KDE_NET_WM_BLUR_BEHIND_REGION_NAME "_KDE_NET_WM_BLUR_BEHIND_REGION"
 #define _GTK_FRAME_EXTENTS "_GTK_FRAME_EXTENTS"
 
 using namespace vlc;
@@ -397,16 +395,6 @@ bool CompositorX11RenderWindow::init()
             return true;
     }
 
-    //check if KDE "acrylic" effect is available
-    xcb_atom_t blurBehindAtom = getInternAtom(qtConn, _KDE_NET_WM_BLUR_BEHIND_REGION_NAME);
-    if (blurBehindAtom != XCB_ATOM_NONE)
-    {
-        uint32_t val = 0;
-        xcb_change_property(qtConn, XCB_PROP_MODE_REPLACE, m_wid,
-                            blurBehindAtom, XCB_ATOM_CARDINAL, 32, 1, &val);
-        m_hasAcrylic = true;
-    }
-
     //_GTK_FRAME_EXTENTS should be available at least on Gnome/KDE/FXCE/Enlightement
     xcb_atom_t gtkExtendFrame = getInternAtom(qtConn, _GTK_FRAME_EXTENTS);
     if (gtkExtendFrame != XCB_ATOM_NONE && wmNetSupport(qtConn, rootWindow, gtkExtendFrame))


=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.hpp
=====================================
@@ -151,6 +151,8 @@ public:
 
 class CompositorX11RenderWindow : public DummyRenderWindow, public AccessibleRenderWindow
 {
+    friend class CompositorX11;
+
     Q_OBJECT
 public:
     explicit CompositorX11RenderWindow(qt_intf_t* p_intf, xcb_connection_t* conn, bool useCSD, QWindow* parent = nullptr);


=====================================
modules/gui/qt/maininterface/kwindowsystem_module.cpp
=====================================
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#include "windoweffects_module.hpp"
+
+#include <QRegion>
+
+#include <vlc_plugin.h>
+
+#include <KWindowEffects>
+
+static bool isEffectAvailable(const WindowEffectsModule::Effect effect)
+{
+    KWindowEffects::Effect kWindowEffect;
+
+    switch (effect)
+    {
+    case WindowEffectsModule::BlurBehind:
+        kWindowEffect = KWindowEffects::BlurBehind;
+        break;
+    default:
+        return false;
+    };
+
+    return KWindowEffects::isEffectAvailable(kWindowEffect);
+}
+
+static void setBlurBehind(QWindow* const window, const bool enable = true)
+{
+    KWindowEffects::enableBlurBehind(window, enable, QRegion());
+}
+
+static int Open(vlc_object_t* const p_this)
+{
+    assert(p_this);
+
+    // If none of the effects are available,
+    // it probably means that KWindowEffects
+    // does not support the environment.
+    // In that case, simply fail here,
+    // so that another potentially compatible
+    // module can be loaded instead:
+    if (!isEffectAvailable(WindowEffectsModule::BlurBehind))
+        return VLC_EGENERIC;
+
+    const auto obj = reinterpret_cast<WindowEffectsModule*>(p_this);
+
+    obj->setBlurBehind = setBlurBehind;
+    obj->isEffectAvailable = isEffectAvailable;
+
+    return VLC_SUCCESS;
+}
+
+vlc_module_begin()
+    add_shortcut("QtKWindowSystem")
+    set_description("Provides window effects through KWindowSystem.")
+    set_capability("qtwindoweffects", 10)
+    set_callback(Open)
+vlc_module_end()


=====================================
modules/gui/qt/maininterface/win32windoweffects_module.cpp
=====================================
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#include "win32windoweffects_module.hpp"
+#include "windoweffects_module.hpp"
+
+#include <QOperatingSystemVersion>
+#include <QWindow>
+
+#include <cassert>
+
+#include <dwmapi.h>
+
+static bool isEffectAvailable(const WindowEffectsModule::Effect effect)
+{
+    // Version check is done on module open, no need to re-do it here.
+    switch (effect)
+    {
+    case WindowEffectsModule::BlurBehind:
+        return true;
+    default:
+        return false;
+    };
+}
+
+static void setBlurBehind(QWindow* const window, const bool enable = true)
+{
+    assert(window);
+    assert(window->winId()); // use QWindow::create() before calling this function
+
+    enum BackdropType
+    {
+        DWMSBT_NONE = 1,
+        DWMSBT_TRANSIENTWINDOW = 3
+    } backdropType = enable ? DWMSBT_TRANSIENTWINDOW : DWMSBT_NONE;
+
+    DwmSetWindowAttribute(reinterpret_cast<HWND>(window->winId()),
+                          38 /* DWMWA_SYSTEMBACKDROP_TYPE */,
+                          &backdropType,
+                          sizeof(backdropType));
+}
+
+int QtWin32WindowEffectsOpen(vlc_object_t* p_this)
+{
+    assert(p_this);
+
+    if (QOperatingSystemVersion::current()
+        < QOperatingSystemVersion(QOperatingSystemVersion::Windows, 11, 0, 22621))
+        return VLC_EGENERIC;
+
+    const auto obj = reinterpret_cast<WindowEffectsModule*>(p_this);
+
+    obj->setBlurBehind = setBlurBehind;
+    obj->isEffectAvailable = isEffectAvailable;
+
+    return VLC_SUCCESS;
+}


=====================================
modules/gui/qt/maininterface/win32windoweffects_module.hpp
=====================================
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#ifndef WIN32WINDOWEFFECTS_MODULE_HPP
+#define WIN32WINDOWEFFECTS_MODULE_HPP
+
+#include <vlc_common.h>
+
+int QtWin32WindowEffectsOpen(vlc_object_t* p_this);
+
+#endif // WIN32WINDOWEFFECTS_MODULE_HPP


=====================================
modules/gui/qt/maininterface/windoweffects_module.hpp
=====================================
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#ifndef WINDOWEFFECTSMODULE_HPP
+#define WINDOWEFFECTSMODULE_HPP
+
+#include <vlc_common.h>
+
+class QWindow;
+
+struct WindowEffectsModule
+{
+    enum Effect {
+        BlurBehind
+    };
+
+    vlc_object_t obj;
+
+    module_t *p_module = nullptr;
+    void *p_sys = nullptr;
+
+    bool (*isEffectAvailable)(Effect effect);
+    void (*setBlurBehind)(QWindow* window, bool enable);
+};
+
+#endif // WINDOWEFFECTSMODULE_HPP


=====================================
modules/gui/qt/meson.build
=====================================
@@ -292,6 +292,7 @@ some_sources = files(
     'maininterface/videosurface.hpp',
     'maininterface/video_window_handler.cpp',
     'maininterface/video_window_handler.hpp',
+    'maininterface/windoweffects_module.hpp',
     'medialibrary/medialib.cpp',
     'medialibrary/medialib.hpp',
     'medialibrary/mlalbum.cpp',
@@ -649,6 +650,25 @@ if qt6_dep.found()
         endif
     endif
 
+    if host_system == 'windows'
+        some_sources += files('maininterface/win32windoweffects_module.cpp',
+                              'maininterface/win32windoweffects_module.hpp')
+    else
+        kf6WindowSystem_dep = dependency('KF6WindowSystem',
+                                         version: '>=6.0.0',
+                                         required: false)
+        if (kf6WindowSystem_dep.found())
+            vlc_modules += {
+                'name' : 'qtwindoweffects',
+                'sources' : files(
+                    'maininterface/windoweffects_module.hpp',
+                    'maininterface/kwindowsystem_module.cpp',
+                ),
+                'dependencies' : [kf6WindowSystem_dep, qt6_dep]
+            }
+        endif
+    endif
+
     # TODO support qmlcachegen
 
     vlc_modules += {


=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -66,6 +66,7 @@ extern "C" char **environ;
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 # include "maininterface/mainctx_win32.hpp"
+#include "maininterface/win32windoweffects_module.hpp"
 #else
 # include "maininterface/mainctx.hpp"   /* MainCtx creation */
 #endif
@@ -439,6 +440,12 @@ vlc_module_begin ()
         set_callback( WindowsThemeProviderOpen )
         set_description( "Qt Windows theme" )
         add_shortcut("qt-themeprovider-windows")
+
+    add_submodule ()
+        add_shortcut( "QtWin32WindowEffects" )
+        set_description( "Provides window effects on Windows." )
+        set_capability( "qtwindoweffects", 10 )
+        set_callback( QtWin32WindowEffectsOpen )
 #endif
     add_submodule()
         set_capability("qt theme provider", 1)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f9d948ca036f641bf49e042b62632906d609d95e...7b98948bbef16b7810708113beb56363fd85c0f2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f9d948ca036f641bf49e042b62632906d609d95e...7b98948bbef16b7810708113beb56363fd85c0f2
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