diff --git a/src/backend/gdi.c b/src/backend/gdi.c index 119d39f..d878a48 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -694,7 +694,12 @@ char* MwLLGetClipboard(MwLL handle) { void MwLLMakeToolWindow(MwLL handle) { LPARAM lp = GetWindowLongPtr(handle->hWnd, GWL_STYLE) & WS_VISIBLE; + RECT rc; SetWindowLongPtr(handle->hWnd, GWL_STYLE, (LPARAM)lp); SetWindowLongPtr(handle->hWnd, GWL_EXSTYLE, (LPARAM)WS_EX_TOOLWINDOW); + + GetClientRect(handle->hWnd, &rc); + + SetWindowPos(handle->hWnd, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); } diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 4eccee1..499cd66 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -231,7 +231,7 @@ static void frame_draw(MwWidget handle) { MwLLDrawPixmap(handle->lowlevel, &r2, lb->list[i].pixmap); } p.y += MwTextHeight(handle, "M") / 2; - p.x = MwGetInteger(handle->parent, MwNleftPadding); + p.x = MwGetInteger(handle->parent, MwNleftPadding) + MwDefaultBorderWidth(handle); for(j = 0; j < arrlen(lb->list[i].name); j++) { char* t = lb->list[i].name[j];