[vlc-commits] [Git][videolan/vlc][master] qt: hide interface window on close before waiting it to be handled

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Feb 22 07:15:26 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d3b9d6dc by Fatih Uzunoglu at 2025-02-21T15:22:52+00:00
qt: hide interface window on close before waiting it to be handled

We are intercepting and inhibiting the close event for several reasons:
- Idle inhibit case (not inhibiting close used to crash at least Wayland).
- Video window using resources of the interface window case (Wayland, DComp).

Furthermore for the latter case we postpone destroying the window (hence
closing) even more, to the point destroying the window does not cause harm
with regard to the video window (fdb0a981 for DComp, 6923be9b for Wayland).

Because of this, the time between user clicks on the close button and the
window effectively closes is too much for responsiveness.

I propose to hide the window until destroying (and closing) to make close
more responsive. This should be fine because hiding should not
release the resources, as the default value of
`QQuickWindow::setPersistentGraphics()` is true and we are not overriding
it and we do not expect to override it as well.

I have also checked if this would cause saving the window state as hidden
before closing. However, `QVLCTools::saveWindowPosition()` does not save\
it so it should be fine.

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -246,14 +246,15 @@ bool InterfaceWindowHandler::eventFilter(QObject*, QEvent* event)
     }
     case QEvent::Close:
     {
+        setInterfaceHiden();
+
         if (var_InheritBool(p_intf, "qt-close-to-system-tray"))
         {
             if (const QSystemTrayIcon* const sysTrayIcon = m_mainCtx->getSysTray())
             {
                 if (sysTrayIcon->isSystemTrayAvailable() && sysTrayIcon->isVisible())
                 {
-                    setInterfaceHiden();
-                    event->accept();
+                    event->ignore();
                     return true;
                 }
             }



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

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