[vlc-commits] [Git][videolan/vlc][master] qt: disable using top level (independent) window for tool tip until Qt 6.8.2

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Jan 5 14:22:30 UTC 2025



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


Commits:
93598293 by Fatih Uzunoglu at 2025-01-05T13:59:21+00:00
qt: disable using top level (independent) window for tool tip until Qt 6.8.2

This feature has not been tested properly by Qt, it often causes crashes.

- - - - -


2 changed files:

- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/widgets/qml/ToolTipExt.qml


Changes:

=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -258,6 +258,19 @@ public:
 
     int mouseHideTimeout() const { return m_mouseHideTimeout; }
 
+    Q_INVOKABLE static inline bool useTopLevelWindowForToolTip() {
+        assert(qGuiApp);
+        if (QT_VERSION < QT_VERSION_CHECK(6, 8, 0))
+            return false; // Feature is not available
+#ifndef QT_STATIC // We have patched contrib Qt to fix both of the spotted Qt bugs
+        if (QT_VERSION < QT_VERSION_CHECK(6, 8, 2))
+            return false; // This feature was not tested properly upstream, and often causes crashes (QTBUG-131898, #28919).
+#endif
+        if (qGuiApp->platformName().startsWith(QLatin1String("wayland")))
+            return false; // Wayland is too buggy (tested with KWin 6.2), and there is no sign it'll improve by Qt 6.8.2 (QTBUG-131899).
+        return true;
+    }
+
     Q_INVOKABLE static inline void setCursor(Qt::CursorShape cursor) { QApplication::setOverrideCursor(QCursor(cursor)); }
     Q_INVOKABLE static inline void restoreCursor(void) { QApplication::restoreOverrideCursor(); }
 


=====================================
modules/gui/qt/widgets/qml/ToolTipExt.qml
=====================================
@@ -19,6 +19,7 @@
 import QtQuick
 import QtQuick.Templates as T
 
+import VLC.MainInterface
 import VLC.Style
 
 T.ToolTip {
@@ -40,9 +41,10 @@ T.ToolTip {
     closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
 
     Component.onCompleted: {
-        if (typeof control.popupType === "number")
-            if (Qt.platform.pluginName !== "wayland") // FIXME: Qt 6.8.0 Wayland is not reliable
-                control.popupType = 1 // Popup.Window
+        if (MainCtx.useTopLevelWindowForToolTip()) {
+            console.assert(typeof control.popupType === "number")
+            control.popupType = 1 // Popup.Window
+        }
     }
 
     // NOTE: The tool tip often moves around, particularly noticable



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

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