mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibGUI: Don't update windows that aren't visible (#1410)
Because the ID of a hidden window is 0, the window server will fail to update them when the system theme is changed. This manifests when an application has multiple windows, some of which are hidden, and the system theme is changed (see https://github.com/SerenityOS/serenity/issues/1378). This PR changes the window code to ignore update messages if the window has the ID 0--is hidden. Ideally the window ID would not change, and visibility would be managed separately.
This commit is contained in:
parent
39a843470c
commit
4c9bb266df
Notes:
sideshowbarker
2024-07-19 08:46:08 +09:00
Author: https://github.com/muscar Commit: https://github.com/SerenityOS/serenity/commit/4c9bb266dff Pull-request: https://github.com/SerenityOS/serenity/pull/1410
1 changed files with 4 additions and 2 deletions
|
@ -348,6 +348,8 @@ void Window::update()
|
|||
|
||||
void Window::force_update()
|
||||
{
|
||||
if (!this->is_visible())
|
||||
return;
|
||||
auto rect = this->rect();
|
||||
WindowServerConnection::the().post_message(Messages::WindowServer::InvalidateRect(m_window_id, { { 0, 0, rect.width(), rect.height() } }, true));
|
||||
}
|
||||
|
@ -633,8 +635,8 @@ void Window::schedule_relayout()
|
|||
|
||||
void Window::update_all_windows(Badge<WindowServerConnection>)
|
||||
{
|
||||
for (auto* window : *all_windows) {
|
||||
window->force_update();
|
||||
for (auto& e : *reified_windows) {
|
||||
e.value->force_update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue