1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

WindowServer+LibGUI: Allow arbitrary number of rects in messages.

To get truly atomic updates, add a mechanism for passing arbitrary amounts
of extra data along with WindowServer messages. This allows us to pass all
the rects in a single message.
This commit is contained in:
Andreas Kling 2019-04-22 01:15:47 +02:00
parent f9d3abf5d0
commit 9f122bff5a
12 changed files with 167 additions and 60 deletions

View file

@ -109,12 +109,14 @@ struct WSAPI_ServerMessage {
};
Type type { Invalid };
int window_id { -1 };
unsigned extra_size { 0 };
union {
int text_length { 0 };
int rect_count;
};
static const int max_inline_rect_count = 1;
union {
char text[512];
WSAPI_Rect rects[32];
@ -214,13 +216,16 @@ struct WSAPI_ClientMessage {
};
Type type { Invalid };
int window_id { -1 };
unsigned extra_size { 0 };
union {
int text_length { 0 };
int rect_count;
};
static const int max_inline_rect_count = 1;
union {
char text[512];
WSAPI_Rect rects[32];
WSAPI_Rect rects[max_inline_rect_count];
};
int value { 0 };