From 49fd09b6224d42cbfecc73972c587c22197c5c88 Mon Sep 17 00:00:00 2001 From: tsujan Date: Fri, 8 Sep 2023 16:16:13 +0330 Subject: [PATCH] Fixed the tooltips of volume control under Wayland (#1933) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … by setting their parent widgets. X11 sees no change. Fixes https://github.com/lxqt/lxqt-panel/issues/1927 --- plugin-volume/volumebutton.cpp | 4 ++-- plugin-volume/volumepopup.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-volume/volumebutton.cpp b/plugin-volume/volumebutton.cpp index 10c579b31..95df40460 100644 --- a/plugin-volume/volumebutton.cpp +++ b/plugin-volume/volumebutton.cpp @@ -80,7 +80,7 @@ void VolumeButton::setMixerCommand(const QString &command) void VolumeButton::enterEvent(QEvent *event) { // show tooltip immediately on entering widget - QToolTip::showText(static_cast(event)->globalPos(), toolTip()); + QToolTip::showText(static_cast(event)->globalPos(), toolTip(), this); } void VolumeButton::mouseMoveEvent(QMouseEvent *event) @@ -88,7 +88,7 @@ void VolumeButton::mouseMoveEvent(QMouseEvent *event) QToolButton::mouseMoveEvent(event); // show tooltip immediately on moving the mouse if (!QToolTip::isVisible()) // prevent sliding of tooltip - QToolTip::showText(event->globalPos(), toolTip()); + QToolTip::showText(event->globalPos(), toolTip(), this); } void VolumeButton::wheelEvent(QWheelEvent *event) diff --git a/plugin-volume/volumepopup.cpp b/plugin-volume/volumepopup.cpp index 4b85363ec..24a50afae 100644 --- a/plugin-volume/volumepopup.cpp +++ b/plugin-volume/volumepopup.cpp @@ -127,7 +127,7 @@ void VolumePopup::handleSliderValueChanged(int value) return; // qDebug("VolumePopup::handleSliderValueChanged: %d\n", value); m_device->setVolume(value); - QTimer::singleShot(0, this, [this] { QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip()); }); + QTimer::singleShot(0, this, [this] { QToolTip::showText(QCursor::pos(), m_volumeSlider->toolTip(), this); }); } void VolumePopup::handleMuteToggleClicked()