[vlc-commits] [Git][videolan/vlc][master] qt: do not let qt to close the interface window itself

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 23 14:33:26 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b83603de by Fatih Uzunoglu at 2024-11-23T14:16:18+00:00
qt: do not let qt to close the interface window itself

... as it may be necessary by the application,
particularly for the window inhibit case.

- - - - -


3 changed files:

- modules/gui/qt/maininterface/interface_window_handler.cpp
- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx.hpp


Changes:

=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -244,18 +244,9 @@ bool InterfaceWindowHandler::eventFilter(QObject*, QEvent* event)
             }
         }
 
-        bool ret = m_mainCtx->onWindowClose(m_window);
-        if (ret)
-        {
-            /* Accept session quit. Otherwise we break the desktop mamager. */
-            event->accept();
-            return false;
-        }
-        else
-        {
-            event->ignore();
-            return true;
-        }
+        m_mainCtx->onWindowClose(m_window);
+        event->ignore();
+        return true;
     }
     default:
         break;


=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -774,7 +774,7 @@ VideoSurfaceProvider* MainCtx::getVideoSurfaceProvider() const
  * Events stuff
  ************************************************************************/
 
-bool MainCtx::onWindowClose( QWindow* )
+void MainCtx::onWindowClose( QWindow* )
 {
     PlaylistController* playlistController = p_intf->p_mainPlaylistController;
     PlayerController* playerController = p_intf->p_mainPlayerController;
@@ -792,12 +792,10 @@ bool MainCtx::onWindowClose( QWindow* )
             }
         });
         playlistController->stop();
-        return false;
     }
     else
     {
         emit askToQuit(); /* ask THEDP to quit, so we have a unique method */
-        return true;
     }
 }
 


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -278,9 +278,8 @@ public:
 
     /**
      * @brief ask for the application to terminate
-     * @return true if the application can be close right away, false if it will be delayed
      */
-    bool onWindowClose(QWindow* );
+    void onWindowClose(QWindow* );
 
     bool acrylicActive() const;
     void setAcrylicActive(bool newAcrylicActive);



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

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