From ca62ddf733697a3b11a2f80aeaafcf5085a51ff9 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 10 Oct 2025 12:39:07 +0000 Subject: [PATCH] fixed #54, titlebar works git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@253 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/backend/gdi.c | 4 +++- src/widget/menu.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/gdi.c b/src/backend/gdi.c index 1e49f15..970aee2 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -66,7 +66,9 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { } else if(msg == WM_ERASEBKGND) { return 1; } else if(msg == WM_NCHITTEST) { - return HTCLIENT; + LPARAM style = GetWindowLongPtr(hWnd, GWL_STYLE); + if(style & WS_CHILD) return HTCLIENT; + return DefWindowProc(hWnd, msg, wp, lp); } else if(msg == WM_DESTROY) { MwLLDispatch(u->ll, close, NULL); PostQuitMessage(0); diff --git a/src/widget/menu.c b/src/widget/menu.c index fe199ee..300e495 100644 --- a/src/widget/menu.c +++ b/src/widget/menu.c @@ -129,7 +129,7 @@ static void mouse_down(MwWidget handle) { if(m->sub[i]->wsub == NULL && arrlen(m->sub[i]->sub) > 0) { MwPoint p2; - p2.x = p.x - tw / 2 - 5; + p2.x = p.x - 5; p2.y = p.y + th / 2 + 5; m->sub[i]->wsub = MwCreateWidget(MwSubMenuClass, "submenu", handle, 0, 0, 0, 0);