From f78f487b205ca3e8130550b5d29fabbf45f13960 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 22 Mar 2014 21:46:17 +0100 Subject: [PATCH] Implement quirk NOFOCUSCYCLE to remove a window from the normal focus cycle. --- spectrwm.1 | 3 +++ spectrwm.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/spectrwm.1 b/spectrwm.1 index 3df76e1..837b5db 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -1024,6 +1024,9 @@ 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 NOFOCUSCYCLE +Remove from normal focus cycle (focus_prev or focus_next). The window can +still be focused using search_win. .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 b0e2d50..680f5c1 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -681,6 +681,7 @@ struct quirk { #define SWM_Q_OBEYAPPFOCUSREQ (1<<8) /* Focus when applications ask. */ #define SWM_Q_IGNOREPID (1<<9) /* Ignore PID when determining ws. */ #define SWM_Q_IGNORESPAWNWS (1<<10) /* Ignore _SWM_WS when managing win. */ +#define SWM_Q_NOFOCUSCYCLE (1<<11) /* Remove from normal focus cycle. */ }; TAILQ_HEAD(quirk_list, quirk); struct quirk_list quirks = TAILQ_HEAD_INITIALIZER(quirks); @@ -4395,7 +4396,8 @@ focus(struct swm_region *r, union arg *args) } while (winfocus && (ICONIC(winfocus) || winfocus->id == cur_focus->transient || (cur_focus->transient != XCB_WINDOW_NONE && - winfocus->transient == cur_focus->transient))); + winfocus->transient == cur_focus->transient) || + (winfocus->quirks & SWM_Q_NOFOCUSCYCLE))); break; case SWM_ARG_ID_FOCUSNEXT: if (cur_focus == NULL) @@ -4411,7 +4413,8 @@ focus(struct swm_region *r, union arg *args) } while (winfocus && (ICONIC(winfocus) || winfocus->id == cur_focus->transient || (cur_focus->transient != XCB_WINDOW_NONE && - winfocus->transient == cur_focus->transient))); + winfocus->transient == cur_focus->transient) || + (winfocus->quirks & SWM_Q_NOFOCUSCYCLE))); break; case SWM_ARG_ID_FOCUSMAIN: if (cur_focus == NULL) @@ -7717,6 +7720,7 @@ const char *quirkname[] = { "OBEYAPPFOCUSREQ", "IGNOREPID", "IGNORESPAWNWS", + "NOFOCUSCYCLE", }; /* SWM_Q_DELIM: retain '|' for back compat for now (2009-08-11) */ -- 2.39.2