From 922f09b9d5f5f1073a466d6bd03c5e8ea1dac243 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Mon, 10 Nov 2025 00:26:10 +0000 Subject: [PATCH] fix bug git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@655 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/backend/x11.c | 15 +++++++++++++++ src/widget/listbox.c | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/backend/x11.c b/src/backend/x11.c index 3536cda..a7dfc61 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -292,15 +292,30 @@ void MwLLSetXY(MwLL handle, int x, int y) { } void MwLLSetWH(MwLL handle, int w, int h) { + XSizeHints sh; + long r; + + XGetWMNormalHints(handle->display, handle->window, &sh, &r); + if(w < 2) w = 2; if(h < 2) h = 2; + sh.flags |= PSize; + sh.width = w; + sh.height = h; + XResizeWindow(handle->display, handle->window, w, h); + XSetWMNormalHints(handle->display, handle->window, &sh); + + destroy_pixmap(handle); + create_pixmap(handle); handle->width = w; handle->height = h; XSync(handle->display, False); + + MwLLForceRender(handle); } void MwLLFreeColor(MwLLColor color) { diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 0132758..23e5dd0 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -208,7 +208,6 @@ static void frame_draw(MwWidget handle) { area = r.height - MwDefaultBorderWidth(handle) * 2; ent = area / MwTextHeight(handle, "M"); - for(i = st; i < arrlen(lb->list) && i < st + ent; i++) { int selected = lb->selected == i ? 1 : 0; int j;