Commit ecb43ae3 authored by Robert Knight's avatar Robert Knight
Browse files

Avoid scrolling views unnecessarily when splitting the view.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=673774
parent a13b5ea1
......@@ -83,6 +83,8 @@
#include <QtCore/QTextStream>
#include <QtCore/QThread>
#include <QtCore/QTime>
// KDE
#include <kdebug.h>
......@@ -129,7 +131,6 @@ ScreenWindow* Emulation::createWindow()
window->setScreen(_currentScreen);
_windows << window;
//FIXME - Used delayed updates when the selection changes
connect(window , SIGNAL(selectionChanged()),
this , SLOT(bufferedUpdate()));
......@@ -456,6 +457,7 @@ char Emulation::getErase() const
void Emulation::setImageSize(int lines, int columns)
{
//qDebug() << "Resizing image to: " << lines << "by" << columns << QTime::currentTime().msec();
Q_ASSERT( lines > 0 );
Q_ASSERT( columns > 0 );
......
......@@ -156,6 +156,7 @@ bool ScreenWindow::atEndOfOutput() const
void ScreenWindow::scrollTo( int line )
{
//qDebug() << "ScreenWindow scrolled to " << line << ":" << this;
if ( line < 0 )
line = 0;
......
......@@ -461,11 +461,19 @@ void Session::updateTerminalSize()
int minLines = -1;
int minColumns = -1;
// minimum number of lines and columns that views require for
// their size to be taken into consideration ( to avoid problems
// with new view widgets which haven't yet been set to their correct size )
const int VIEW_LINES_THRESHOLD = 2;
const int VIEW_COLUMNS_THRESHOLD = 2;
//select largest number of lines and columns that will fit in all visible views
while ( viewIter.hasNext() )
{
TerminalDisplay* view = viewIter.next();
if ( view->isHidden() == false )
if ( view->isHidden() == false &&
view->lines() >= VIEW_LINES_THRESHOLD &&
view->columns() >= VIEW_COLUMNS_THRESHOLD )
{
minLines = (minLines == -1) ? view->lines() : qMin( minLines , view->lines() );
minColumns = (minColumns == -1) ? view->columns() : qMin( minColumns , view->columns() );
......
Supports Markdown
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