diff options
author | Charlie Root <John Ankarstr\xf6m> | 2021-06-01 16:41:45 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-01 16:42:52 +0200 |
commit | e5377b0df3382bf8b0149c2e59568ea08a85e80f (patch) | |
tree | 43edbb3e9246914a9e631eae57356b117b9bfc99 | |
parent | f60e475e92886bc8f30617884078ebf4489c6711 (diff) | |
download | jwm-e5377b0df3382bf8b0149c2e59568ea08a85e80f.tar.gz |
Double-click to shade
I more often want to temporarily get rid of windows than maximize them.
-rw-r--r-- | jwm.1.in | 2 | ||||
-rw-r--r-- | src/event.c | 5 |
2 files changed, 5 insertions, 2 deletions
@@ -1055,7 +1055,7 @@ The middle button will move anywhere on the frame. .RE .P .RS -A double click on the title bar of a window will toggle the maximized state +A double click on the title bar of a window will toggle the shaded state of the window. Scrolling up over the title bar will shade the window and scrolling down will unshade the window. When a menu is open, the scroll wheel will move through menus. diff --git a/src/event.c b/src/event.c index a1cc943..76a9fff 100644 --- a/src/event.c +++ b/src/event.c @@ -1102,7 +1102,10 @@ void DispatchBorderButtonEvent(const XButtonEvent *event, ClientNode *np) { && abs(event->time - lastClickTime) <= doubleClickSpeed && abs(event->x - lastX) <= doubleClickDelta && abs(event->y - lastY) <= doubleClickDelta) { - MaximizeClient(np); + if(np->state.status & STAT_SHADED) + UnshadeClient(np); + else + ShadeClient(np); doubleClickActive = 0; } else { if(MoveClient(np, event->x, event->y)) { |