summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-09 23:56:24 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-09 23:59:35 +0200
commit1f24ab91f2f67735e87e34cff5fe46a9be67ac86 (patch)
treeafb93fe730d1c15d985c70d24dd2db7173ae2b2a
parenta47d576e9449c8f0f4e2e98b3b40be14b18eefe6 (diff)
downloadserenity-1f24ab91f2f67735e87e34cff5fe46a9be67ac86.zip
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.
-rw-r--r--Userland/Services/WindowServer/Window.cpp1
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp8
-rw-r--r--Userland/Services/WindowServer/WindowManager.h1
3 files changed, 10 insertions, 0 deletions
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;