mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:08:11 +00:00
WindowServer: Don't send Paint messages to minimized windows.
There's no point in painting if it can't be seen anyway. We also make sure to request a repaint when un-minimizing, so the window gets a chance to repaint itself then.
This commit is contained in:
parent
48e3ea9e5c
commit
dc919352b0
2 changed files with 5 additions and 1 deletions
|
@ -510,10 +510,12 @@ void WSClientConnection::handle_request(const WSAPIDestroyWindowRequest& request
|
|||
|
||||
void WSClientConnection::post_paint_message(WSWindow& window)
|
||||
{
|
||||
auto rect_set = window.take_pending_paint_rects();
|
||||
if (window.is_minimized())
|
||||
return;
|
||||
WSAPI_ServerMessage message;
|
||||
message.type = WSAPI_ServerMessage::Type::Paint;
|
||||
message.window_id = window.window_id();
|
||||
auto rect_set = window.take_pending_paint_rects();
|
||||
auto& rects = rect_set.rects();
|
||||
message.rect_count = rects.size();
|
||||
for (int i = 0; i < min(WSAPI_ServerMessage::max_inline_rect_count, rects.size()); ++i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue