[vlc-commits] Qt: Fix tooltip position

Olivier Fourdan git at videolan.org
Wed Aug 8 18:21:20 CEST 2018


vlc/vlc-3.0 | branch: master | Olivier Fourdan <ofourdan at redhat.com> | Tue Jul 31 10:55:45 2018 +0200| [33849a7fc3a948da2ddd6a96533e057583ef8e54] | committer: Hugo Beauzée-Luyssen

Qt: Fix tooltip position

commit 5815534 ("qt: make the time tooltip a tooltip") reintroduced the
bug fixed by previous commit ea99237 ("remove X11BypassWindowManagerHint
from time tooltip") meant to fix #17829.

The tooltip window is a shaped, override-redirect window which shows
when the pointer enters the slider and disappears when it leaves the
slider.

By placing the tooltip window too low, above the slider, vlc causes a
constant map/unmap of that window which will flood Xwayland and the
Wayland compositori.window manager and can up with a deadlock situation.

When the tooltip window is showing, the pointer will enter the tooltip
window and thus leave the slider, which will cause the tooltip to be
unmapped, which in turn causes the pointer to re-enter the slider area,
which will cause the tooltip to show again, so on and so forth.

On Wayland/Xwayland where the Wayland compositor (i.e. the display
server) is also the window manager, that can lead to a deadlock
situation because some X11 requests are blocking on rountrips to the
Xserver, which in the case of Xwayland is also a Wayland client, waiting
on the Wayland compositor for some operations, the Wayland compositor
being also a Window manager and an X11 client at the same time...

Avoid the issue by placing the tooltip so that it does not show up at
the same location where the slider is, without overlap, to avoid that
map/unmap requests storm.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/244
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit 6579a36c56ed30b72de584bf0e8cf21af1a90cf7)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=33849a7fc3a948da2ddd6a96533e057583ef8e54
---

 modules/gui/qt/util/timetooltip.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/util/timetooltip.cpp b/modules/gui/qt/util/timetooltip.cpp
index 1314b520ea..7a63a9d7d9 100644
--- a/modules/gui/qt/util/timetooltip.cpp
+++ b/modules/gui/qt/util/timetooltip.cpp
@@ -73,7 +73,7 @@ void TimeTooltip::adjustPosition()
 #if defined( Q_OS_WIN )
         mTarget.y() - 2 * size.height() - TIP_HEIGHT / 2 );
 #else
-        mTarget.y() - size.height() + TIP_HEIGHT / 2 );
+        mTarget.y() - size.height() - TIP_HEIGHT / 2 );
 #endif
 
     // Keep the tooltip on the same screen if possible



More information about the vlc-commits mailing list