Skip to content

Commit ae9b228

Browse files
committed
fix(ptk): incorrect window minmaxinfo
1 parent 1de2dfd commit ae9b228

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/ptk/src/windows/win32_app.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ static LRESULT CALLBACK ptk_window_process(HWND hwnd, UINT msg, WPARAM arg1,
329329
info->min_height = MIN_HEIGHT;
330330
info->max_width = GetSystemMetrics(SM_CXMAXTRACK);
331331
info->max_height = GetSystemMetrics(SM_CYMAXTRACK);
332+
ptk_process_event(&e);
332333
convert_client_size_to_window_size(wnd, &info->min_width,
333334
&info->min_height);
334335
convert_client_size_to_window_size(wnd, &info->max_width,
@@ -345,7 +346,7 @@ static LRESULT CALLBACK ptk_window_process(HWND hwnd, UINT msg, WPARAM arg1,
345346
style &= ~WS_MAXIMIZEBOX;
346347
}
347348
SetWindowLong(hwnd, GWL_STYLE, style);
348-
break;
349+
return 0;
349350
}
350351
case WM_DPICHANGED: {
351352
RECT *const new_rect = (RECT *)arg2;

lib/ui-server/src/server.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ static void ui_server_on_window_dpi_changed(ptk_event_t *e, void *arg)
239239

240240
static void ui_server_on_window_minmaxinfo(ptk_event_t *e, void *arg)
241241
{
242-
bool resizable = false;
243242
int width, height;
244243
ui_widget_t *widget;
245244
css_computed_style_t *style;
@@ -258,33 +257,26 @@ static void ui_server_on_window_minmaxinfo(ptk_event_t *e, void *arg)
258257
e->minmaxinfo.min_width = ui_compute(style->min_width);
259258
if (width < e->minmaxinfo.min_width) {
260259
width = e->minmaxinfo.min_width;
261-
resizable = true;
262260
}
263261
}
264262
if (IS_CSS_FIXED_LENGTH(style, max_width)) {
265263
e->minmaxinfo.max_width = ui_compute(style->max_width);
266264
if (width > e->minmaxinfo.max_width) {
267265
width = e->minmaxinfo.max_width;
268-
resizable = true;
269266
}
270267
}
271268
if (IS_CSS_FIXED_LENGTH(style, min_height)) {
272269
e->minmaxinfo.min_height = ui_compute(style->min_height);
273270
if (height < e->minmaxinfo.min_height) {
274271
height = e->minmaxinfo.min_height;
275-
resizable = true;
276272
}
277273
}
278274
if (IS_CSS_FIXED_LENGTH(style, max_height)) {
279275
e->minmaxinfo.max_height = ui_compute(style->max_height);
280276
if (height > e->minmaxinfo.max_height) {
281277
height = e->minmaxinfo.max_height;
282-
resizable = true;
283278
}
284279
}
285-
if (resizable) {
286-
ptk_window_set_size(e->window, width, height);
287-
}
288280
}
289281

290282
static void ui_server_on_destroy_widget(ui_widget_t *widget, ui_event_t *e,

0 commit comments

Comments
 (0)