From c80e278706bb72ec2a72e9f567839d4235f28faf Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Tue, 14 Oct 2025 13:58:25 +0000 Subject: [PATCH] windowmaker is weird git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@325 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/backend/x11.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/backend/x11.c b/src/backend/x11.c index 84422a2..e8f33b1 100644 --- a/src/backend/x11.c +++ b/src/backend/x11.c @@ -611,14 +611,25 @@ void MwLLShow(MwLL handle, int show) { } void MwLLMakePopup(MwLL handle, MwLL parent) { - Atom wndtype = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE", False); - Atom wnddlg = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE_DIALOG", False); - Atom wndstate = XInternAtom(handle->display, "_NET_WM_STATE", False); - Atom wndmodal = XInternAtom(handle->display, "_NET_WM_STATE_MODAL", False); + Atom wndtype = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE", False); + Atom wnddlg = XInternAtom(handle->display, "_NET_WM_WINDOW_TYPE_DIALOG", False); + Atom wndstate = XInternAtom(handle->display, "_NET_WM_STATE", False); + Atom wndmodal = XInternAtom(handle->display, "_NET_WM_STATE_MODAL", False); + int x = 0, y = 0; + Window child, root, parentx; + Window* children; + unsigned int nchild; + + XQueryTree(handle->display, handle->window, &root, &parentx, &children, &nchild); + if(children != NULL) XFree(children); + + XTranslateCoordinates(handle->display, parentx, RootWindow(handle->display, DefaultScreen(handle->display)), 0, 0, &x, &y, &child); 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); + + XMoveWindow(handle->display, handle->window, x, y); } void MwLLSetSizeHints(MwLL handle, int minx, int miny, int maxx, int maxy) {