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
wilder-portage
Robert Knight 18 years ago
parent 2c9e073c0e
commit 25bdf5fca9
  1. 10
      src/TerminalDisplay.cpp
  2. 3
      src/TerminalDisplay.h

@ -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;

Loading…
Cancel
Save