fix(ptk): emit window size event synchronously on Windows

Hidden windows may not receive WM_SIZE, so the gallery native resize tests saw stale root sizes. Emit PTK_EVENT_SIZE with the requested client size, matching the X11 backend.
This commit is contained in:
Liu
2026-11-21 14:45:27 +08:00
parent e50a5fa5fd
commit e26cd958a0
+7
View File
@@ -697,6 +697,7 @@ void ptk_window_set_size(ptk_window_t *wnd, int width, int height)
{
int client_width = width;
int client_height = height;
ptk_event_t e = { 0 };
if (wnd->width == width && wnd->height == height) {
return;
@@ -709,6 +710,12 @@ void ptk_window_set_size(ptk_window_t *wnd, int width, int height)
* must not observe the previous value. */
wnd->width = client_width;
wnd->height = client_height;
/* Hidden windows may not receive WM_SIZE, so notify listeners now. */
e.type = PTK_EVENT_SIZE;
e.window = wnd;
e.size.width = client_width;
e.size.height = client_height;
ptk_process_event(&e);
}
void ptk_window_show(ptk_window_t *wnd)