mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user