From e5377b0df3382bf8b0149c2e59568ea08a85e80f Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Tue, 1 Jun 2021 16:41:45 +0200 Subject: Double-click to shade I more often want to temporarily get rid of windows than maximize them. --- jwm.1.in | 2 +- src/event.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jwm.1.in b/jwm.1.in index 194ed21..5ea21fc 100644 --- a/jwm.1.in +++ b/jwm.1.in @@ -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)) { -- cgit v1.2.3