[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt/DCompositorAcrylicSurface: check pointer before use

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Sep 26 18:07:40 UTC 2021



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


Commits:
ed289609 by Prince Gupta at 2021-09-26T17:47:10+00:00
qt/DCompositorAcrylicSurface: check pointer before use

- - - - -
2e3f71cd by Prince Gupta at 2021-09-26T17:47:10+00:00
qt/DCompositor: show window after initialization

fixes blank window visible at startup
ref #26104

- - - - -
a6004919 by Prince Gupta at 2021-09-26T17:47:10+00:00
qt: fix window restore with CSD on windows

restore windows after initialization of CSDWin32EventHandler

ref #26104

- - - - -


3 changed files:

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


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -292,7 +292,6 @@ MainInterface* CompositorDirectComposition::makeMainInterface()
         m_mainInterface = new MainInterfaceWin32(m_intf);
 
         m_rootWindow = new QWindow();
-        m_rootWindow->show();
 
         m_taskbarWidget = std::make_unique<WinTaskbarWidget>(m_intf, m_rootWindow);
         qApp->installNativeEventFilter(m_taskbarWidget.get());
@@ -349,6 +348,7 @@ MainInterface* CompositorDirectComposition::makeMainInterface()
         connect(qGuiApp, &QGuiApplication::screenAdded, this, resetAcrylicSurface);
         connect(qGuiApp, &QGuiApplication::screenRemoved, this, resetAcrylicSurface);
 
+        m_rootWindow->show();
         return m_mainInterface;
     }
     catch (const DXError& err)


=====================================
modules/gui/qt/maininterface/compositor_dcomp_acrylicsurface.cpp
=====================================
@@ -351,7 +351,7 @@ void CompositorDCompositionAcrylicSurface::sync()
     int frameX = 0;
     int frameY = 0;
 
-    if (!m_intf->p_mi->useClientSideDecoration())
+    if (m_intf->p_mi && !m_intf->p_mi->useClientSideDecoration())
     {
         frameX = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);
         frameY = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION)


=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -39,21 +39,18 @@ InterfaceWindowHandler::InterfaceWindowHandler(qt_intf_t *_p_intf, MainInterface
     m_window->setMinimumWidth( 450 );
     m_window->setMinimumHeight( 300 );
 
-    QVLCTools::restoreWindowPosition( getSettings(), m_window, QSize(600, 420) );
-
-    WindowStateHolder::holdOnTop( m_window,  WindowStateHolder::INTERFACE, m_mainInterface->isInterfaceAlwaysOnTop() );
-    WindowStateHolder::holdFullscreen( m_window,  WindowStateHolder::INTERFACE, m_window->visibility() == QWindow::FullScreen );
-
-
-    if (m_mainInterface->isHideAfterCreation())
+    // this needs to be called asynchronously
+    // otherwise QQuickWidget won't initialize properly
+    QMetaObject::invokeMethod(this, [this]()
     {
-        //this needs to be called asynchronously
-        //otherwise QQuickWidget won't initialize properly
-        QMetaObject::invokeMethod(this, [this]() {
-                m_window->hide();
-            }, Qt::QueuedConnection, nullptr);
-    }
+        QVLCTools::restoreWindowPosition( getSettings(), m_window, QSize(600, 420) );
+
+        WindowStateHolder::holdOnTop( m_window,  WindowStateHolder::INTERFACE, m_mainInterface->isInterfaceAlwaysOnTop() );
+        WindowStateHolder::holdFullscreen( m_window,  WindowStateHolder::INTERFACE, m_window->visibility() == QWindow::FullScreen );
 
+        if (m_mainInterface->isHideAfterCreation())
+            m_window->hide();
+    }, Qt::QueuedConnection, nullptr);
 
     m_window->setTitle("");
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/18c638a991855b6b794b70b792b8ef744960e918...a6004919b37c4a31dbf5d2360bdba3fac3f4c06c

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




More information about the vlc-commits mailing list