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;