From d9f4c914862a01598f1da64bfcff4dfae6873ebb Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 11 Jun 2008 17:20:44 +0000 Subject: [PATCH] Update pty window size when the image size is changed via escape codes from the terminal. CCBUG: 163782 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=819652 --- src/Session.cpp | 12 ++++++------ src/Session.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Session.cpp b/src/Session.cpp index af446a1cc..8381fb06d 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -136,6 +136,7 @@ void Session::openTeletype(int fd) connect( _emulation,SIGNAL(lockPtyRequest(bool)),_shellProcess,SLOT(lockPty(bool)) ); connect( _emulation,SIGNAL(useUtf8Request(bool)),_shellProcess,SLOT(setUtf8Mode(bool)) ); connect( _shellProcess,SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(done(int)) ); + connect( _emulation,SIGNAL(imageSizeChanged(int,int)),this,SLOT(updateWindowSize(int,int)) ); } WId Session::windowId() const @@ -556,10 +557,6 @@ void Session::onViewSizeChange(int /*height*/, int /*width*/) { updateTerminalSize(); } -void Session::onEmulationSizeChange(int lines , int columns) -{ - setSize( QSize(lines,columns) ); -} void Session::updateTerminalSize() { @@ -591,10 +588,13 @@ void Session::updateTerminalSize() if ( minLines > 0 && minColumns > 0 ) { _emulation->setImageSize( minLines , minColumns ); - _shellProcess->setWindowSize( minLines , minColumns ); } } - +void Session::updateWindowSize(int lines, int columns) +{ + Q_ASSERT(lines > 0 && columns > 0); + _shellProcess->setWindowSize(lines,columns); +} void Session::refresh() { // attempt to get the shell process to redraw the display diff --git a/src/Session.h b/src/Session.h index 1e6ddc33e..2a0922203 100644 --- a/src/Session.h +++ b/src/Session.h @@ -490,7 +490,6 @@ private slots: void monitorTimerDone(); void onViewSizeChange(int height, int width); - void onEmulationSizeChange(int lines , int columns); void activityStateSet(int); @@ -503,6 +502,7 @@ private slots: void zmodemFinished(); void updateFlowControlState(bool suspended); + void updateWindowSize(int lines, int columns); private: void updateTerminalSize();