Commit 25bdf5fc authored by Robert Knight's avatar Robert Knight
Browse files

Fix terminal display jumping to bottom of screen when trying to scroll up with...

Fix terminal display jumping to bottom of screen when trying to scroll up with the scrollbar already at the top.  Spotted by Matthew Woehlke.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=792354
parent 2c9e073c
......@@ -2123,13 +2123,6 @@ void TerminalDisplay::mouseDoubleClickEvent(QMouseEvent* ev)
SLOT(tripleClickTimeout()));
}
bool TerminalDisplay::canScroll() const
{
bool sliderAtTop = _scrollBar->value() == 0;
bool sliderAtBottom = _scrollBar->value() + _scrollBar->pageStep() >= _scrollBar->maximum();
return !(sliderAtTop && sliderAtBottom);
}
void TerminalDisplay::wheelEvent( QWheelEvent* ev )
{
if (ev->orientation() != Qt::Vertical)
......@@ -2141,7 +2134,8 @@ void TerminalDisplay::wheelEvent( QWheelEvent* ev )
// for the benefit of programs such as 'less'
if ( _mouseMarks )
{
if (canScroll())
bool canScroll = _scrollBar->maximum() > 0;
if (canScroll)
_scrollBar->event(ev);
else
{
......
......@@ -649,9 +649,6 @@ private:
// redraws the cursor
void updateCursor();
// returns true if the scroll bar thumb could be moved
bool canScroll() const;
// the window onto the terminal screen which this display
// is currently showing.
QPointer<ScreenWindow> _screenWindow;
......
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