Optimize SIGWINCH Shell notification
Fixes issue with missed SIGWINCH shell notification in case the Terminal frame was resized by using any of "Settings"->"Window size" menu items. Fixes #9293 - original problem was pointed out by Ziusudra. Thank you!
This commit is contained in:
@@ -551,7 +551,7 @@ TermView::Columns() const
|
|||||||
|
|
||||||
//! Set number of rows and columns in terminal
|
//! Set number of rows and columns in terminal
|
||||||
BRect
|
BRect
|
||||||
TermView::SetTermSize(int rows, int columns)
|
TermView::SetTermSize(int rows, int columns, bool notifyShell)
|
||||||
{
|
{
|
||||||
//debug_printf("TermView::SetTermSize(%d, %d)\n", rows, columns);
|
//debug_printf("TermView::SetTermSize(%d, %d)\n", rows, columns);
|
||||||
if (rows > 0)
|
if (rows > 0)
|
||||||
@@ -591,6 +591,9 @@ TermView::SetTermSize(int rows, int columns)
|
|||||||
offset + rows + 2);
|
offset + rows + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (notifyShell)
|
||||||
|
fFrameResized = true;
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +605,7 @@ TermView::SetTermSize(BRect rect)
|
|||||||
int columns;
|
int columns;
|
||||||
|
|
||||||
GetTermSizeFromRect(rect, &rows, &columns);
|
GetTermSizeFromRect(rect, &rows, &columns);
|
||||||
SetTermSize(rows, columns);
|
SetTermSize(rows, columns, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1575,9 +1578,7 @@ TermView::FrameResized(float width, float height)
|
|||||||
if (fResizeViewDisableCount > 0)
|
if (fResizeViewDisableCount > 0)
|
||||||
fResizeViewDisableCount--;
|
fResizeViewDisableCount--;
|
||||||
|
|
||||||
SetTermSize(rows, columns);
|
SetTermSize(rows, columns, true);
|
||||||
|
|
||||||
fFrameResized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ public:
|
|||||||
void GetFontSize(int* width, int* height);
|
void GetFontSize(int* width, int* height);
|
||||||
int Rows() const;
|
int Rows() const;
|
||||||
int Columns() const;
|
int Columns() const;
|
||||||
BRect SetTermSize(int rows, int cols);
|
BRect SetTermSize(int rows, int cols,
|
||||||
|
bool notifyShell);
|
||||||
void SetTermSize(BRect rect);
|
void SetTermSize(BRect rect);
|
||||||
void GetTermSizeFromRect(const BRect &rect,
|
void GetTermSizeFromRect(const BRect &rect,
|
||||||
int *rows, int *columns);
|
int *rows, int *columns);
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ TermWindow::MessageReceived(BMessage *message)
|
|||||||
|
|
||||||
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
for (int32 i = 0; i < fTabView->CountTabs(); i++) {
|
||||||
TermView* view = _TermViewAt(i);
|
TermView* view = _TermViewAt(i);
|
||||||
view->SetTermSize(rows, columns);
|
view->SetTermSize(rows, columns, true);
|
||||||
_ResizeView(view);
|
_ResizeView(view);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user