From 82055c267baf1d5e592f833d04755c4e896b3940 Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Mon, 2 Sep 2013 17:52:42 +0200 Subject: [PATCH] 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 --- src/apps/terminal/TermView.cpp | 6 +++--- src/apps/terminal/TermView.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 393f0a1ccd..fa4c3fae15 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -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); diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h index 53f7e706cc..eb275b701e 100644 --- a/src/apps/terminal/TermView.h +++ b/src/apps/terminal/TermView.h @@ -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);