1
0
Fork 0

Fix: Relocate main toolbar and statusbar before other windows.

When repositioning all windows, the main toolbar and statusbar need to already be in position to ensure that window captions are visible.
pull/12218/head
Peter Nelson 2024-01-01 23:53:16 +00:00
parent 626ee4ab41
commit 7f88a5beaf
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 14 additions and 12 deletions

View File

@ -3436,6 +3436,18 @@ void RelocateAllWindows(int neww, int newh)
{ {
CloseWindowByClass(WC_DROPDOWN_MENU); CloseWindowByClass(WC_DROPDOWN_MENU);
/* Reposition toolbar then status bar before other all windows. */
if (Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0); wt != nullptr) {
ResizeWindow(wt, std::min<uint>(neww, _toolbar_width) - wt->width, 0, false);
wt->left = PositionMainToolbar(wt);
}
if (Window *ws = FindWindowById(WC_STATUS_BAR, 0); ws != nullptr) {
ResizeWindow(ws, std::min<uint>(neww, _toolbar_width) - ws->width, 0, false);
ws->top = newh - ws->height;
ws->left = PositionStatusbar(ws);
}
for (Window *w : Window::Iterate()) { for (Window *w : Window::Iterate()) {
int left, top; int left, top;
/* XXX - this probably needs something more sane. For example specifying /* XXX - this probably needs something more sane. For example specifying
@ -3447,24 +3459,14 @@ void RelocateAllWindows(int neww, int newh)
continue; continue;
case WC_MAIN_TOOLBAR: case WC_MAIN_TOOLBAR:
ResizeWindow(w, std::min<uint>(neww, _toolbar_width) - w->width, 0, false); case WC_STATUS_BAR:
continue;
top = w->top;
left = PositionMainToolbar(w); // changes toolbar orientation
break;
case WC_NEWS_WINDOW: case WC_NEWS_WINDOW:
top = newh - w->height; top = newh - w->height;
left = PositionNewsMessage(w); left = PositionNewsMessage(w);
break; break;
case WC_STATUS_BAR:
ResizeWindow(w, std::min<uint>(neww, _toolbar_width) - w->width, 0, false);
top = newh - w->height;
left = PositionStatusbar(w);
break;
case WC_SEND_NETWORK_MSG: case WC_SEND_NETWORK_MSG:
ResizeWindow(w, std::min<uint>(neww, _toolbar_width) - w->width, 0, false); ResizeWindow(w, std::min<uint>(neww, _toolbar_width) - w->width, 0, false);