[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: correctly propagate minimize query

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Sun Aug 22 13:17:08 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
60126641 by Prince Gupta at 2021-08-22T13:04:16+00:00
qt: correctly propagate minimize query

- - - - -
3874467a by Prince Gupta at 2021-08-22T13:04:16+00:00
qt/VideoWindowHandler: fix abrupt window size changes

fixes abrupt window size changes when any media is played

'm_lastWinGeometry' should only be set before going into the full
screen, initializing it with 'm_window' causes window size restore
inside 'setVideoFullScreen'

- - - - -


4 changed files:

- modules/gui/qt/maininterface/interface_window_handler.cpp
- modules/gui/qt/maininterface/main_interface.hpp
- modules/gui/qt/maininterface/video_window_handler.cpp
- modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml


Changes:

=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -100,6 +100,14 @@ InterfaceWindowHandler::InterfaceWindowHandler(qt_intf_t *_p_intf, MainInterface
     connect(m_mainInterface, &MainInterface::requestInterfaceNormal,
             m_window, &QWindow::showNormal);
 
+    connect(m_mainInterface, &MainInterface::requestInterfaceMinimized,
+            m_window, [this]()
+    {
+        // taking OR with the current state, we preserve the current state
+        // so with next active request, we restore window in it's pre-minimized state
+        m_window->setWindowStates(m_window->windowStates() | Qt::WindowMinimized);
+    });
+
     m_window->installEventFilter(this);
 }
 


=====================================
modules/gui/qt/maininterface/main_interface.hpp
=====================================
@@ -349,6 +349,8 @@ signals:
     void requestInterfaceMaximized();
     /// forward window normal query to the actual window or widget
     void requestInterfaceNormal();
+    /// forward window normal query to the actual window or widget
+    void requestInterfaceMinimized();
 
     void intfScaleFactorChanged();
     void pinVideoControlsChanged( bool );


=====================================
modules/gui/qt/maininterface/video_window_handler.cpp
=====================================
@@ -47,13 +47,8 @@ void VideoWindowHandler::setWindow(QWindow* window)
         WindowStateHolder::holdOnTop(m_window, WindowStateHolder::VIDEO, false);
         WindowStateHolder::holdFullscreen(m_window, WindowStateHolder::VIDEO, false);
     }
+
     m_window = window;
-    if (m_window)
-    {
-        m_lastWinGeometry = m_window->geometry();
-    }
-    else
-        m_lastWinGeometry = QRect{};
 }
 
 void VideoWindowHandler::disable()


=====================================
modules/gui/qt/widgets/qml/CSDWindowButtonSet.qml
=====================================
@@ -31,7 +31,7 @@ Row {
 
     CSDWindowButton {
         iconTxt: VLCIcons.window_minimize
-        onClicked: topWindow.showMinimized()
+        onClicked: mainInterface.requestInterfaceMinimized()
         height: windowButtonGroup.height
         color: windowButtonGroup.color
         hoverColor: windowButtonGroup.hoverColor



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c7ab524092e40c4a7fb0435f8d6a2948bc00a850...3874467ae48d0e48d29faeb5863dd268c13917bc

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




More information about the vlc-commits mailing list