Commit c0aff2e9 authored by Ferdinand Bachmann's avatar Ferdinand Bachmann Committed by Kurt Hindenburg

Fix scrollbar reappearing when using the touchpad (only on Wayland)

On Wayland, sometimes the scrollbar reappears on the left side of the
screen even when the scrollbar is set to 'hidden'.

- This happens when scrolling twice using the touchpad.
- This only happens on Wayland
- This only happens with Qt 5.14 or newer

This patch is a workaround for a change in Qt 5.14. Due "scroll phases",
scrollbars get set to visible when starting to scroll, and don't hide
themselves afterwards.

BUG: 415508
FIXED-IN: 20.08

!127
parent 34e6e343
......@@ -2096,11 +2096,17 @@ void TerminalDisplay::setScrollBarPosition(Enum::ScrollBarPositionEnum position)
return;
}
_scrollBar->setHidden(position == Enum::ScrollBarHidden);
_scrollbarLocation = position;
applyScrollBarPosition(true);
}
propagateSize();
update();
void TerminalDisplay::applyScrollBarPosition(bool propagate) {
_scrollBar->setHidden(_scrollbarLocation == Enum::ScrollBarHidden);
if (propagate) {
propagateSize();
update();
}
}
void TerminalDisplay::scrollBarPositionChanged(int)
......@@ -2745,6 +2751,11 @@ void TerminalDisplay::wheelEvent(QWheelEvent* ev)
_scrollBar->event(ev);
// Reapply scrollbar position since the scrollbar event handler
// sometimes makes the scrollbar visible when set to hidden.
// Don't call propagateSize and update, since nothing changed.
applyScrollBarPosition(false);
Q_ASSERT(_sessionController != nullptr);
_sessionController->setSearchStartToWindowCurrentLine();
......
......@@ -678,6 +678,10 @@ private:
// current size in columns and lines
void showResizeNotification();
// applies changes to scrollbarLocation to the scroll bar and
// if @propagate is true, propagates size information
void applyScrollBarPosition(bool propagate = true);
// scrolls the image by a number of lines.
// 'lines' may be positive ( to scroll the image down )
// or negative ( to scroll the image up )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment