[vlc-commits] [Git][videolan/vlc][master] qt: do not hide the interface window on wayland
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Mar 6 14:24:13 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
c3e5f6c6 by Fatih Uzunoglu at 2025-03-06T14:07:06+00:00
qt: do not hide the interface window on wayland
- - - - -
1 changed file:
- modules/gui/qt/maininterface/interface_window_handler.cpp
Changes:
=====================================
modules/gui/qt/maininterface/interface_window_handler.cpp
=====================================
@@ -376,6 +376,32 @@ void InterfaceWindowHandler::setBoss()
void InterfaceWindowHandler::setInterfaceHiden()
{
+#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
+ // `CompositorWayland` depends on the promise that the window resources are not deleted.
+ // Window's `wl_surface` gets deleted when the window gets hidden before Qt 6.9.0. So,
+ // here we should inhibit hiding the window. Note that intercepting `QEvent::hide` does
+ // not make it possible to inhibit hiding the window.
+ assert(p_intf);
+ assert(p_intf->p_compositor);
+ static bool inhibitHide = [intf = p_intf]() {
+ assert(qGuiApp);
+ // type() == WaylandCompositor is not used because any video embedding methodology may
+ // depend on window resources:
+ const bool ret = qGuiApp->platformName().startsWith(QLatin1String("wayland")) &&
+ dynamic_cast<vlc::CompositorVideo*>(intf->p_compositor.get());
+ if (ret)
+ msg_Warn(intf, "In this configuration, the interface window can not get hidden.");
+ return ret;
+ }();
+
+ if (inhibitHide)
+ {
+ // Instead of doing nothing, minimize the window:
+ setInterfaceMinimized();
+ return;
+ }
+#endif
+
m_window->hide();
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c3e5f6c619cb5cba60503ca99ae10defaca18224
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c3e5f6c619cb5cba60503ca99ae10defaca18224
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