summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-08-21 20:04:33 +0200
committerAndreas Kling <kling@serenityos.org>2022-08-21 20:04:33 +0200
commit17687435ca528986d1c84a87d2fa96e394762f54 (patch)
tree2b6b946ac5b99194199bac176046a907c496e7ba /Userland/Services
parent42435ce5e475c355330f3cb16d2334a339588cb9 (diff)
downloadserenity-17687435ca528986d1c84a87d2fa96e394762f54.zip
WindowServer: Redraw menu items after client updates them somehow
This fixes an issue where the undo/redo actions in TextEditor only updated once you hovered over them.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WindowServer/ConnectionFromClient.cpp2
-rw-r--r--Userland/Services/WindowServer/Menu.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/ConnectionFromClient.cpp b/Userland/Services/WindowServer/ConnectionFromClient.cpp
index 04a03cc8c3..4a451e9fb3 100644
--- a/Userland/Services/WindowServer/ConnectionFromClient.cpp
+++ b/Userland/Services/WindowServer/ConnectionFromClient.cpp
@@ -191,6 +191,8 @@ void ConnectionFromClient::update_menu_item(i32 menu_id, i32 identifier, [[maybe
menu_item->set_default(is_default);
if (checkable)
menu_item->set_checked(checked);
+
+ menu.redraw(*menu_item);
}
void ConnectionFromClient::remove_menu_item(i32 menu_id, i32 identifier)
diff --git a/Userland/Services/WindowServer/Menu.cpp b/Userland/Services/WindowServer/Menu.cpp
index 390a86f64f..3254f05bda 100644
--- a/Userland/Services/WindowServer/Menu.cpp
+++ b/Userland/Services/WindowServer/Menu.cpp
@@ -106,6 +106,8 @@ void Menu::redraw()
void Menu::redraw(MenuItem const& menu_item)
{
+ if (!menu_window())
+ return;
draw(menu_item);
menu_window()->invalidate(menu_item.rect());
}