From 978e4b1b00bfa61a9bafcbe9b60fa339773ddcea Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Fri, 10 Oct 2014 15:04:12 +0800 Subject: [PATCH] Fix MINIMALBORDER on region focus cycling. Fix quirk ordering in man page. --- spectrwm.1 | 4 ++-- spectrwm.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spectrwm.1 b/spectrwm.1 index f03b59e..97b0b70 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -1047,11 +1047,11 @@ Remove border to allow window to use full region size. .It FOCUSPREV On exit force focus on previously focused application not previous application in the stack. +.It MINIMALBORDER +Remove border when window is unfocused and floating. .It NOFOCUSCYCLE Remove from normal focus cycle (focus_prev or focus_next). The window can still be focused using search_win. -.It MINIMALBORDER -Remove border when window is unfocused and floating. .It NOFOCUSONMAP Don't change focus to the window when it first appears on the screen. Has no effect when diff --git a/spectrwm.c b/spectrwm.c index b84694b..0e29167 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -3655,6 +3655,16 @@ focus_win(struct ws_win *win) &cfw->s->c[(MAXIMIZED(cfw) ? SWM_S_COLOR_UNFOCUS_MAXIMIZED : SWM_S_COLOR_UNFOCUS)].pixel); + + /* Update border width */ + if (cfw->bordered && + (cfw->quirks & SWM_Q_MINIMALBORDER) && + FLOATING(cfw)) { + cfw->bordered = 0; + X(cfw) += border_width; + Y(cfw) += border_width; + update_window(cfw); + } } else { unfocus_win(cfw); } -- 2.39.2