[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt: show the window if the "auto raise" setting is enabled

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Oct 2 12:33:41 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
747e45a5 by Fatih Uzunoglu at 2026-10-02T14:22:58+02:00
qt: show the window if the "auto raise" setting is enabled

- - - - -
71ad52da by Fatih Uzunoglu at 2026-10-02T14:22:58+02:00
qt: do not activate the window by default in window visibility adjustment

Adjusting the visibility should not by default activate the window as well.

- - - - -
b9c7d1ac by Fatih Uzunoglu at 2026-10-02T14:22:58+02:00
qt: handle window raise also on vout change

When input change is signalled, it may not be resolved
yet if there is video. For that, we can listen VOut
change.

- - - - -


8 changed files:

- modules/gui/qt/dialogs/systray/systray.cpp
- modules/gui/qt/maininterface/interface_window_handler.cpp
- modules/gui/qt/maininterface/interface_window_handler.hpp
- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/maininterface/mainctx_win32.cpp
- modules/gui/qt/maininterface/mainctx_win32.hpp
- modules/gui/qt/qt.cpp


Changes:

=====================================
modules/gui/qt/dialogs/systray/systray.cpp
=====================================
@@ -73,14 +73,14 @@ VLCSystray::~VLCSystray()
  */
 void VLCSystray::toggleUpdateMenu()
 {
-    m_ctx->toggleWindowVisibility();
+    m_ctx->toggleWindowVisibility(true);
     update();
 }
 
 /* First Item of the systray menu */
 void VLCSystray::showUpdateMenu()
 {
-    m_ctx->setInterfaceVisibible(true);
+    m_ctx->setInterfaceVisibible(true, true);
     update();
 }
 


=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -344,18 +344,20 @@ void InterfaceWindowHandler::onVideoEmbedChanged(bool embed)
 }
 
 
-void InterfaceWindowHandler::toggleWindowVisibility()
+void InterfaceWindowHandler::toggleWindowVisibility(bool _requestActivate)
 {
     switch ( m_window->visibility() )
     {
     case QWindow::Hidden:
         /* If hidden, show it */
         setInterfaceShown();
-        requestActivate();
+        if (_requestActivate)
+            requestActivate();
         break;
     case QWindow::Minimized:
         setInterfaceNormal();
-        requestActivate();
+        if (_requestActivate)
+            requestActivate();
         break;
     default:
         setInterfaceHiden();
@@ -364,7 +366,7 @@ void InterfaceWindowHandler::toggleWindowVisibility()
 }
 
 
-void InterfaceWindowHandler::setInterfaceVisible(bool visible)
+void InterfaceWindowHandler::setInterfaceVisible(bool visible, bool _requestActivate)
 {
     if (visible)
     {
@@ -372,14 +374,17 @@ void InterfaceWindowHandler::setInterfaceVisible(bool visible)
         {
         case QWindow::Hidden:
             setInterfaceShown();
+            if (_requestActivate)
+                requestActivate();
             break;
         case QWindow::Minimized:
             setInterfaceNormal();
+            if (_requestActivate)
+                requestActivate();
             break;
         default:
             break;
         }
-        requestActivate();
     }
     else
     {
@@ -401,6 +406,21 @@ void InterfaceWindowHandler::setInterfaceFullScreen( bool fs )
 
 void InterfaceWindowHandler::setRaise()
 {
+    assert(m_window);
+
+    switch ( m_window->visibility() )
+    {
+    case QWindow::Hidden:
+        /* If hidden, show it */
+        setInterfaceShown();
+        break;
+    case QWindow::Minimized:
+        setInterfaceNormal();
+        break;
+    default:
+        break;
+    }
+
     requestActivate();
     m_window->raise();
 }


=====================================
modules/gui/qt/maininterface/interface_window_handler.hpp
=====================================
@@ -40,8 +40,8 @@ protected slots:
     virtual void setFullScreen( bool fs );
     virtual void setInterfaceFullScreen( bool fs );
     virtual void setInterfaceAlwaysOnTop( bool on_top );
-    virtual void toggleWindowVisibility();
-    virtual void setInterfaceVisible(bool);
+    virtual void toggleWindowVisibility(bool requestActivate = false);
+    virtual void setInterfaceVisible(bool, bool requestActivate = false);
     virtual void setInterfaceHiden();
     virtual void setInterfaceShown();
     virtual void setInterfaceMinimized();


=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -243,6 +243,7 @@ MainCtx::MainCtx(qt_intf_t *_p_intf)
     /* Main Interface statusbar */
     /* and title of the Main Interface*/
     connect( THEMIM, &PlayerController::inputChanged, this, &MainCtx::onInputChanged );
+    connect( THEMIM, &PlayerController::hasVideoOutputChanged, this, &MainCtx::onVOutChanged );
 
     /* END CONNECTS ON IM */
 
@@ -529,6 +530,13 @@ void MainCtx::onInputChanged( bool hasInput )
     emit askRaise();
 }
 
+void MainCtx::onVOutChanged( bool video )
+{
+    int autoRaise = var_InheritInteger( p_intf, "qt-auto-raise" );
+    if ( video && ( autoRaise & MainCtx::RAISE_VIDEO ) )
+        emit askRaise();
+}
+
 #ifdef KeyPress
 #undef KeyPress
 #endif


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -551,12 +551,13 @@ public slots:
 
 protected slots:
     void onInputChanged( bool );
+    void onVOutChanged( bool );
 
 signals:
     void fullscreenInterfaceToggled( bool );
-    void setInterfaceVisibible(bool );
+    void setInterfaceVisibible(bool, bool requestActivate = false);
     void setInterfaceFullScreen( bool );
-    void toggleWindowVisibility();
+    void toggleWindowVisibility(bool requestActivate = false);
     void askToQuit();
     void askShow();
     void askBoss();


=====================================
modules/gui/qt/maininterface/mainctx_win32.cpp
=====================================
@@ -915,7 +915,7 @@ InterfaceWindowHandlerWin32::~InterfaceWindowHandlerWin32()
     QApplication::instance()->removeNativeEventFilter(this);
 }
 
-void InterfaceWindowHandlerWin32::toggleWindowVisibility()
+void InterfaceWindowHandlerWin32::toggleWindowVisibility(bool _requestActivate)
 {
 
     switch ( m_window->visibility() )
@@ -923,11 +923,13 @@ void InterfaceWindowHandlerWin32::toggleWindowVisibility()
     case QWindow::Hidden:
         /* If hidden, show it */
         setInterfaceShown();
-        requestActivate();
+        if (_requestActivate)
+            requestActivate();
         break;
     case QWindow::Minimized:
         setInterfaceMinimized();
-        requestActivate();
+        if (_requestActivate)
+            requestActivate();
         break;
     default:
         {
@@ -949,7 +951,7 @@ void InterfaceWindowHandlerWin32::toggleWindowVisibility()
             }
             if( !hwnd || !GetWindowInfo( hwnd, &wi ) || (wi.dwExStyle&WS_EX_TOPMOST) )
                 setInterfaceHiden();
-            else
+            else if (_requestActivate)
                 requestActivate();
         }
         break;


=====================================
modules/gui/qt/maininterface/mainctx_win32.hpp
=====================================
@@ -121,7 +121,7 @@ class InterfaceWindowHandlerWin32 : public InterfaceWindowHandler, public QAbstr
 public:
     explicit InterfaceWindowHandlerWin32(qt_intf_t *_p_intf, MainCtx* mainCtx, QWindow* window, QObject *parent = nullptr);
     virtual ~InterfaceWindowHandlerWin32();
-    void toggleWindowVisibility() override;
+    void toggleWindowVisibility(bool requestActivate = false) override;
 
     bool eventFilter(QObject*, QEvent* event) override;
 


=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -250,7 +250,7 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define VOLUME_MAX_TEXT N_( "Maximum Volume displayed" )
 
 #define AUTORAISE_ON_PLAYBACK_TEXT N_( "When to raise the interface" )
-#define AUTORAISE_ON_PLAYBACK_LONGTEXT N_( "This option allows the interface to be raised automatically " \
+#define AUTORAISE_ON_PLAYBACK_LONGTEXT N_( "This option allows the interface to be shown and raised automatically " \
     "when a video/audio playback starts, or never." )
 
 #define QT_CLIENT_SIDE_DECORATION_TEXT N_( "Enable window titlebar" )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/db2c1b7331d0f8cbc5a207898a3ac58300f8140e...b9c7d1ac312ce8f301ebd252925a5a838cdb2fda

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/db2c1b7331d0f8cbc5a207898a3ac58300f8140e...b9c7d1ac312ce8f301ebd252925a5a838cdb2fda
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list