Terminal:send resize notify on attaching window to view

During adding the second tab the view in the first one may change its
lines count in case the Terminal window was maximized. Send resize
notification to client rpogram on every reattaching view to window.

Fixes #9809
This commit is contained in:
Siarzhuk Zharski 2013-09-02 17:52:42 +02:00
parent b0044e4437
commit 82055c267b
2 changed files with 5 additions and 4 deletions

View File

@ -606,13 +606,13 @@ TermView::SetTermSize(int rows, int columns, bool notifyShell)
void
TermView::SetTermSize(BRect rect)
TermView::SetTermSize(BRect rect, bool notifyShell)
{
int rows;
int columns;
GetTermSizeFromRect(rect, &rows, &columns);
SetTermSize(rows, columns, false);
SetTermSize(rows, columns, notifyShell);
}
@ -1162,7 +1162,7 @@ TermView::AttachedToWindow()
// update the terminal size because it may have changed while the TermView
// was detached from the window. On such conditions FrameResized was not
// called when the resize occured
SetTermSize(Bounds());
SetTermSize(Bounds(), true);
MakeFocus(true);
if (fScrollBar) {
fScrollBar->SetSteps(fFontHeight, fFontHeight * fRows);

View File

@ -81,7 +81,8 @@ public:
int Columns() const;
BRect SetTermSize(int rows, int cols,
bool notifyShell);
void SetTermSize(BRect rect);
void SetTermSize(BRect rect,
bool notifyShell = false);
void GetTermSizeFromRect(const BRect &rect,
int *rows, int *columns);