From cca8044e98bcd1a770bdcfd3e572deb8410f84ec Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 2 Nov 2025 23:55:32 +0000 Subject: [PATCH] things git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@577 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/backend/x11.c | 8 ++++++++ src/color_picker.c | 13 ++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/backend/x11.c b/src/backend/x11.c index b1f4af7..a487be3 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -710,6 +710,14 @@ void MwLLMakePopup(MwLL handle, MwLL parent) { XSetTransientForHint(handle->display, handle->window, parent->window); XChangeProperty(handle->display, handle->window, wndtype, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wnddlg, 1); XChangeProperty(handle->display, handle->window, wndstate, XA_ATOM, 32, PropModeReplace, (unsigned char*)&wndmodal, 1); + + XUnmapWindow(handle->display, handle->window); + XMapWindow(handle->display, handle->window); + + XFlush(handle->display); + XSync(handle->display, False); + + wait_map(handle); } void MwLLSetSizeHints(MwLL handle, int minx, int miny, int maxx, int maxy) { diff --git a/src/color_picker.c b/src/color_picker.c index 18eb97c..8963ad4 100644 --- a/src/color_picker.c +++ b/src/color_picker.c @@ -1,7 +1,7 @@ /* $Id$ */ #include -#define WIN_SIZE 512 +#define WIN_SIZE 464 #define PICKER_SIZE 360 #define IMG_POS_X(w) ((w - PICKER_SIZE) / 2) #define IMG_POS_Y(h) ((h - PICKER_SIZE) / 2) @@ -290,7 +290,7 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) { picker->finish = MwCreateWidget( MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w), - IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, PICKER_SIZE / 8); + IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, (WIN_SIZE - PICKER_SIZE - MARGIN * 4) / 2); MwSetText(picker->finish, MwNtext, "Select"); MwSetInteger(picker->finish, MwnhasBorder, 1); MwSetInteger(picker->finish, MwNinverted, 1); @@ -308,11 +308,18 @@ MwWidget MwColorPicker(MwWidget handle, const char* title) { MwPoint p; color_picker_t* wheel; MwWidget window; + MwSizeHints sh; p.x = p.y = 0; + sh.min_width = sh.max_width = WIN_SIZE; + sh.min_height = sh.max_height = WIN_SIZE; + window = MwVaCreateWidget(MwWindowClass, "main", handle, MwDEFAULT, MwDEFAULT, - WIN_SIZE, WIN_SIZE, MwNtitle, title, NULL); + WIN_SIZE, WIN_SIZE, + MwNtitle, title, + MwNsizeHints, &sh, + NULL); wheel = color_picker_setup(window, WIN_SIZE, WIN_SIZE);