diff --git a/doc/alttab.1 b/doc/alttab.1 index e61e623..128838f 100644 --- a/doc/alttab.1 +++ b/doc/alttab.1 @@ -63,7 +63,7 @@ resource: alttab\.desktops default: \fI0\fR . .IP -Show windows belonging to desktops (workspaces, groups)\. \fINUMBER\fR must be 0, 1 or 2: +Show windows belonging to desktops (workspaces, groups)\. \fINUMBER\fR must be between 0 and 3: . .IP \fI0\fR: Current desktop\. @@ -83,6 +83,9 @@ Doesn\'t work in ratpoison\. .IP In various EWMH WM this desktop may be designed hidden or containing sticky windows\. In i3, it\'s "scratchpad"\. . +.IP +\fI3\fR: All desktops, excluding current one\. +. .TP \fB\-sc\fR \fINUMBER\fR resource: alttab\.screens diff --git a/doc/alttab.1.ronn b/doc/alttab.1.ronn index bc86733..b77a571 100644 --- a/doc/alttab.1.ronn +++ b/doc/alttab.1.ronn @@ -73,7 +73,7 @@ Most command line options have corresponding X resource, see doc/alttab.ad for e resource: alttab.desktops default: <0> - Show windows belonging to desktops (workspaces, groups). must be 0, 1 or 2: + Show windows belonging to desktops (workspaces, groups). must be between 0 and 3: <0>: Current desktop. @@ -88,6 +88,8 @@ Most command line options have corresponding X resource, see doc/alttab.ad for e In various EWMH WM this desktop may be designed hidden or containing sticky windows. In i3, it's "scratchpad". + <3>: All desktops, excluding current one. + * `-sc` : resource: alttab.screens default: <1> diff --git a/src/alttab.c b/src/alttab.c index b3e8ade..1da0492 100644 --- a/src/alttab.c +++ b/src/alttab.c @@ -47,7 +47,7 @@ void helpexit() fprintf(stderr, "alttab, the task switcher.\n\ Options:\n\ -w N window manager: 0=no, 1=ewmh-compatible, 2=ratpoison, 3=old fashion\n\ - -d N desktop: 0=current 1=all, 2=all but special\n\ + -d N desktop: 0=current 1=all, 2=all but special, 3=all but current\n\ -sc N screen: 0=current 1=all\n\ -mm N main modifier mask\n\ -bm N backward scroll modifier mask\n\ @@ -55,7 +55,7 @@ Options:\n\ -mk N keysym of main key\n\ -t NxM tile geometry\n\ -i NxM icon geometry\n\ - -vp geo switcher viewport: focus, pointer, total, WxH+X+Y\n\ + -vp str switcher viewport: focus, pointer, total, WxH+X+Y\n\ -p str switcher position: center, none, +X+Y\n\ -s N icon source: 0=X11 only, 1=fallback to files, 2=best size, 3=files only\n\ -theme name icon theme\n\ diff --git a/src/alttab.h b/src/alttab.h index 7036de8..fd0f22e 100644 --- a/src/alttab.h +++ b/src/alttab.h @@ -141,7 +141,8 @@ typedef struct { #define DESK_CURRENT 0 #define DESK_ALL 1 #define DESK_NOSPECIAL 2 -#define DESK_MAX 2 +#define DESK_NOCURRENT 3 +#define DESK_MAX 3 #define DESK_DEFAULT DESK_CURRENT int option_desktop; #define SCR_MIN 0 diff --git a/src/ewmh.c b/src/ewmh.c index 5714604..d054606 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -260,6 +260,13 @@ int ewmh_initWinlist(quad screen) } continue; } + if (g.option_desktop == DESK_NOCURRENT + && current_desktop == window_desktop) { + if (g.debug > 1) { + fprintf (stderr, "window on current desktop, skipped\n"); + } + continue; + } if (g.option_screen == SCR_CURRENT) { if (! get_absolute_coordinates(w, &wq)) { diff --git a/src/win.c b/src/win.c index 1a90725..c667833 100644 --- a/src/win.c +++ b/src/win.c @@ -28,7 +28,7 @@ along with alttab. If not, see . #include #include #include -#include +//#include #include "alttab.h" #include "util.h" extern Globals g;