mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
WindowServer: Add locking and fix coalesced invalidation race.
WSWindowManager::invalidate() had a bug where it would mark the entire screen rect as dirty, but it wouldn't scheduled a deferred recompose. This would cause any subsequent calls to invalidate(Rect) to be coalesced with the pending compose, but the pending compose never happened.
This commit is contained in:
parent
431e7bf085
commit
9c1c885483
4 changed files with 13 additions and 9 deletions
|
@ -68,6 +68,7 @@ WSWindow& WSMenu::ensure_menu_window()
|
|||
}
|
||||
|
||||
auto window = make<WSWindow>(*this);
|
||||
WSWindowLocker locker(*window);
|
||||
window->set_rect(0, 0, width(), height());
|
||||
m_menu_window = move(window);
|
||||
draw();
|
||||
|
@ -78,6 +79,7 @@ WSWindow& WSMenu::ensure_menu_window()
|
|||
void WSMenu::draw()
|
||||
{
|
||||
ASSERT(menu_window());
|
||||
WSWindowLocker locker(*menu_window());
|
||||
ASSERT(menu_window()->backing());
|
||||
Painter painter(*menu_window()->backing());
|
||||
|
||||
|
@ -103,6 +105,7 @@ void WSMenu::draw()
|
|||
|
||||
void WSMenu::on_window_message(WSMessage& message)
|
||||
{
|
||||
WSWindowLocker locker(*menu_window());
|
||||
ASSERT(menu_window());
|
||||
if (message.type() == WSMessage::MouseMove) {
|
||||
auto* item = item_at(static_cast<WSMouseEvent&>(message).position());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue