Open pmarin opened 11 months ago
Looks like after the window is maximized, the EventLoop calls HandleButtonEvent and MoveClient overwrite np->x and np->y.
Example:
I don’t know the event handling code enough to fix the bug so I just get the location from its window attributes:
--- src/resize.c 2023-12-02 17:33:32.000000000 +0100 +++ ../jwm-old/src/resize.c 2023-12-10 09:33:23.164949556 +0100 @@ -138,10 +138,18 @@ return; } if(np->state.maxFlags) { + XWindowAttributes parent; + XWindowAttributes window; + if(JXGetWindowAttributes(display, np->parent, &parent)) + if(JXGetWindowAttributes(display, np->window, &window)) { + np->x = parent.x+window.x; + np->y = parent.y+window.y; + } np->state.maxFlags = MAX_NONE; WriteState(np); ResetBorder(np); } + if(JUNLIKELY(!GrabMouseForResize(context))) { return; }
The result:
It doesn’t fix the bug (the location overwrite) but at least the resize works correctly.
Looks like after the window is maximized, the EventLoop calls HandleButtonEvent and MoveClient overwrite np->x and np->y.
Example:
I don’t know the event handling code enough to fix the bug so I just get the location from its window attributes:
The result:
It doesn’t fix the bug (the location overwrite) but at least the resize works correctly.