diff --git a/Services/WindowServer/WindowFrame.cpp b/Services/WindowServer/WindowFrame.cpp index 68f2457644..f3b11ff619 100644 --- a/Services/WindowServer/WindowFrame.cpp +++ b/Services/WindowServer/WindowFrame.cpp @@ -328,6 +328,16 @@ void WindowFrame::invalidate_title_bar() } void WindowFrame::notify_window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect) +{ + layout_buttons(); + + auto& wm = WindowManager::the(); + wm.invalidate(frame_rect_for_window(m_window, old_rect)); + wm.invalidate(frame_rect_for_window(m_window, new_rect)); + wm.notify_rect_changed(m_window, old_rect, new_rect); +} + +void WindowFrame::layout_buttons() { auto palette = WindowManager::the().palette(); int window_button_width = palette.window_title_button_width(); @@ -352,11 +362,6 @@ void WindowFrame::notify_window_rect_changed(const Gfx::IntRect& old_rect, const button.set_relative_rect(rect); } } - - auto& wm = WindowManager::the(); - wm.invalidate(frame_rect_for_window(m_window, old_rect)); - wm.invalidate(frame_rect_for_window(m_window, new_rect)); - wm.notify_rect_changed(m_window, old_rect, new_rect); } void WindowFrame::on_mouse_event(const MouseEvent& event) @@ -390,7 +395,7 @@ void WindowFrame::on_mouse_event(const MouseEvent& event) return; } else if (event.type() == Event::MouseUp && event.button() == MouseButton::Left) { // Since the MouseDown event opened a menu, another MouseUp - // from the second click outside the menu wouldn't be considered + // from the second click outside the menu wouldn't be considered // a double click, so let's manually check if it would otherwise // have been be considered to be one auto& wm = WindowManager::the(); diff --git a/Services/WindowServer/WindowFrame.h b/Services/WindowServer/WindowFrame.h index 24bf6a79f0..48373ee7aa 100644 --- a/Services/WindowServer/WindowFrame.h +++ b/Services/WindowServer/WindowFrame.h @@ -53,6 +53,8 @@ public: void did_set_maximized(Badge, bool); + void layout_buttons(); + private: void paint_notification_frame(Gfx::Painter&); void paint_normal_frame(Gfx::Painter&); diff --git a/Services/WindowServer/WindowManager.cpp b/Services/WindowServer/WindowManager.cpp index e5175c2d99..b79870ff6f 100644 --- a/Services/WindowServer/WindowManager.cpp +++ b/Services/WindowServer/WindowManager.cpp @@ -1388,6 +1388,7 @@ bool WindowManager::update_theme(String theme_path, String theme_name) notified_clients.set(window.client()); } } + window.frame().layout_buttons(); return IterationDecision::Continue; }); MenuManager::the().did_change_theme();