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

Fixed Drag window snapping window back into place if previously resized using ResizeWindowAlt #444

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,17 @@ Client *prevvisible(Client *c);
* {1, 0}
* 1 -> dont confide resize to monitor dimentions
* 0 -> confide resize within monitor dimentions
* */
*/
void resize(Client *c, int32_t x, int32_t y, int32_t width, int32_t height, uint8_t interact);
/* resize a client given parametors without sizehints */
void resizeclient(Client *c, int16_t x, int16_t y, uint16_t width, uint16_t height);

/* moves a client only if specified x/y is different
* interact
* {1, 0}
* 1 -> dont confide resize to monitor dimentions
* 0 -> confide resize within monitor dimentions
*/
void resizemove(Client *c, int16_t x, int16_t y, uint8_t interact);
/* Sends a Protocol Event to specified client */
void sendprotocolevent(Client *c, XCBAtom proto);
/* Sets the flag "alwaysontop" to the provided Client */
Expand Down
15 changes: 15 additions & 0 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,21 @@ resizeclient(Client *c, int16_t x, int16_t y, uint16_t width, uint16_t height)
}
}

void
resizemove(Client *c, int16_t x, int16_t y, uint8_t interact)
{
i32 _x = x;
i32 _y = y;
i32 width = c->w;
i32 height = c->h;
if(applysizehints(c, &_x, &_y, &width, &height, interact))
{
(void)width;
(void)height;
resizeclient(c, _x, _y, c->w, c->h);
}
}

void
sendprotocolevent(Client *c, XCBAtom proto)
{
Expand Down
2 changes: 1 addition & 1 deletion src/toggle.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ DragWindow(
ny = _wm.selmon->wy + _wm.selmon->wh - oldh;

if(c)
{ resize(c, nx, ny, c->w, c->h, 1);
{ resizemove(c, nx, ny, 1);
}
else
{ XCBMoveWindow(_wm.dpy, win, nx, ny);
Expand Down