<table><tr><td style="">yrlf added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27110">View Revision</a></tr></table><br /><div><div><p>I have looked at this a bit more today, in order to help people reproduce this:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">the bug only appears on Wayland, not on X11 or XWayland</li>
</ul>
<p>when looking at the differences between the QWheelEvents between X11 and Wayland, I noticed that the Qt::ScrollPhase of the events is different!</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Mouse scrolling on Wayland: phase is always 0 (phase not supported)</li>
<li class="remarkup-list-item">Touchpad scrolling on Wayland: phase is 1, then 2, then 3 (beginscroll, updatescroll, endscroll)</li>
<li class="remarkup-list-item">Mouse scrolling on X11: phase is always 0</li>
<li class="remarkup-list-item">Touchpad scrolling on X11: phase is always 0</li>
</ul>
<p>This is most likely what triggers the scrollbar becoming visible, because of this code in <tt style="background: #ebebeb; font-size: 13px;">qscrollbar.cpp</tt> in Qt 5.14</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">void QScrollBar::wheelEvent(QWheelEvent *event)
{
event->ignore();
bool horizontal = qAbs(event->angleDelta().x()) > qAbs(event->angleDelta().y());
// The vertical wheel can be used to scroll a horizontal scrollbar, but only if
// there is no simultaneous horizontal wheel movement. This is to avoid chaotic
// scrolling on touchpads.
if (!horizontal && event->angleDelta().x() != 0 && orientation() == Qt::Horizontal)
return;
// scrollbar is a special case - in vertical mode it reaches minimum
// value in the upper position, however QSlider's minimum value is on
// the bottom. So we need to invert the value, but since the scrollbar is
// inverted by default, we need to invert the delta value only for the
// horizontal orientation.
int delta = horizontal ? -event->angleDelta().x() : event->angleDelta().y();
Q_D(QScrollBar);
if (d->scrollByDelta(horizontal ? Qt::Horizontal : Qt::Vertical, event->modifiers(), delta))
event->accept();
if (event->phase() == Qt::ScrollBegin)
d->setTransient(false);
else if (event->phase() == Qt::ScrollEnd)
d->setTransient(true);
}</pre></div>
<p>note the check of <tt style="background: #ebebeb; font-size: 13px;">event->phase()</tt> near the bottom. <tt style="background: #ebebeb; font-size: 13px;">d->setTransient(false)</tt> subsequently calls <tt style="background: #ebebeb; font-size: 13px;">q-show()</tt>, which makes the scrollbar visible.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27110">https://phabricator.kde.org/D27110</a></div></div><br /><div><strong>To: </strong>yrlf, Konsole, hindenburg, tcanabrava<br /><strong>Cc: </strong>konsole-devel, cent, EspadaV8, fbampaloukas, thsurrel, ngraham, maximilianocuria, hindenburg<br /></div>