Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A maximized window created by dragging the window to a border doesn’t store its location correctly. #605

Open
pmarin opened this issue Dec 10, 2023 · 0 comments

Comments

@pmarin
Copy link

pmarin commented Dec 10, 2023

Looks like after the window is maximized, the EventLoop calls HandleButtonEvent and MoveClient overwrite np->x and np->y.

Example:
jwm

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:
jwm_patched

It doesn’t fix the bug (the location overwrite) but at least the resize works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant