From 1f24ab91f2f67735e87e34cff5fe46a9be67ac86 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 9 May 2021 23:56:24 +0200 Subject: WindowServer: Notify WM clients when a window's modified state changes Also update the window switcher for good measure. The window switcher doesn't visualize this information at the moment, but we generally do this when any window state changes. --- Userland/Services/WindowServer/Window.cpp | 1 + Userland/Services/WindowServer/WindowManager.cpp | 8 ++++++++ Userland/Services/WindowServer/WindowManager.h | 1 + 3 files changed, 10 insertions(+) diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index b5182a47b1..5e7946ebe8 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -997,6 +997,7 @@ void Window::set_modified(bool modified) return; m_modified = modified; + WindowManager::the().notify_modified_changed(*this); frame().set_button_icons(); frame().invalidate_titlebar(); } diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 668ebc5675..dd729f132e 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -375,6 +375,14 @@ static bool window_type_has_title(WindowType type) return type == WindowType::Normal || type == WindowType::ToolWindow; } +void WindowManager::notify_modified_changed(Window& window) +{ + if (m_switcher.is_visible()) + m_switcher.refresh(); + + tell_wms_window_state_changed(window); +} + void WindowManager::notify_title_changed(Window& window) { if (!window_type_has_title(window.type())) diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 5adc22e358..58d5ca5ce0 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -78,6 +78,7 @@ public: void notify_opacity_changed(Window&); void notify_occlusion_state_changed(Window&); void notify_progress_changed(Window&); + void notify_modified_changed(Window&); Gfx::IntRect maximized_window_rect(const Window&) const; -- cgit v1.2.3