Skip to content

Commit

Permalink
Add support for _NET_WM_MOVERESIZE_CANCEL.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jun 17, 2024
1 parent a193829 commit 2f85b3c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/movesize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -832,13 +832,17 @@ bool YFrameWindow::canSize(bool horiz, bool vert) {

void YFrameWindow::netMoveSize(int x, int y, int direction)
{
if (movingWindow || sizingWindow)
if (movingWindow || sizingWindow) {
if (direction == _NET_WM_MOVERESIZE_CANCEL)
endMoveSize();
return;
}

int sx[] = { -1, 0, 1, 1, 1, 0, -1, -1, };
int sy[] = { -1, -1, -1, 0, 1, 1, 1, 0, };
const int size = 8;
int sx[size] = { -1, 0, 1, 1, 1, 0, -1, -1, };
int sy[size] = { -1, -1, -1, 0, 1, 1, 1, 0, };

if (inrange(direction, 0, int ACOUNT(sx) - 1)) {
if (inrange(direction, 0, size - 1)) {
MSG(("move size %d %d direction %d", x, y, direction));
startMoveSize(false, true, sx[direction], sy[direction], x, y);
}
Expand Down

0 comments on commit 2f85b3c

Please sign in to comment.