From ddd5e30de81fdee6853c3fd921ad95fa3115a010 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 9 Nov 2025 11:53:13 +0000 Subject: [PATCH] huh git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@653 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/backend/x11.c | 8 ++++---- src/widget/listbox.c | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/x11.c b/src/backend/x11.c index a84d8d6..3536cda 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -106,8 +106,8 @@ MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height) { if(px == MwDEFAULT) px = 0; if(py == MwDEFAULT) py = 0; - if(width < 1) width = 1; - if(height < 1) height = 1; + if(width < 2) width = 2; + if(height < 2) height = 2; if(parent == NULL) { r->display = XOpenDisplay(NULL); @@ -292,8 +292,8 @@ void MwLLSetXY(MwLL handle, int x, int y) { } void MwLLSetWH(MwLL handle, int w, int h) { - if(w < 1) w = 1; - if(h < 1) h = 1; + if(w < 2) w = 2; + if(h < 2) h = 2; XResizeWindow(handle->display, handle->window, w, h); diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 23e5dd0..0132758 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -208,6 +208,7 @@ 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;