diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-22 19:04:34 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-22 19:04:34 +0200 |
commit | fcdc8d0324ab2848e85994d8033e52e6b82e8723 (patch) | |
tree | 78a6f6c9795796690aebba51f4bf8a0628249b11 /src/client.c | |
parent | f9cf1a4e89bbef715422665206949dfca561f770 (diff) | |
download | jwm-fcdc8d0324ab2848e85994d8033e52e6b82e8723.tar.gz |
Move cursor to window when middle-clicked in taskbar
Diffstat (limited to 'src/client.c')
-rw-r--r-- | src/client.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c index 6c1976e..14c214c 100644 --- a/src/client.c +++ b/src/client.c @@ -875,6 +875,28 @@ void KillClient(ClientNode *np) { NULL); } +/** Move the cursor to the middle of the client. **/ +void MoveMouseToClient(ClientNode *np) { + + int height, width, x, y; + + x = np->x; + y = np->y; + width = np->width; + height = np->height; + if(np->state.border & BORDER_OUTLINE) { + x -= borderWidth; + y -= borderWidth; + width += borderWidth * 2; + height += borderWidth * 2; + } + if(np->state.border & BORDER_TITLE) { + y -= titleHeight; + height += titleHeight; + } + MoveMouse(rootWindow, x + width / 2, y + height / 2); +} + /** Raise the client. This will affect transients. */ void RaiseClient(ClientNode *np) { |