mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +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
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
Add a link
Reference in a new issue