Skip to content

Commit

Permalink
Fixed the tooltips of volume control under Wayland (#1933)
Browse files Browse the repository at this point in the history
… by setting their parent widgets. X11 sees no change.

Fixes #1927
  • Loading branch information
tsujan authored Sep 8, 2023
1 parent 7cfb999 commit 49fd09b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugin-volume/volumebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ void VolumeButton::setMixerCommand(const QString &command)
void VolumeButton::enterEvent(QEvent *event)
{
// show tooltip immediately on entering widget
QToolTip::showText(static_cast<QEnterEvent*>(event)->globalPos(), toolTip());
QToolTip::showText(static_cast<QEnterEvent*>(event)->globalPos(), toolTip(), this);
}

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)
Expand Down
2 changes: 1 addition & 1 deletion plugin-volume/volumepopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 49fd09b

Please sign in to comment.