summaryrefslogtreecommitdiffstats
path: root/tabbed.c
diff options
context:
space:
mode:
authorJonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>2015-08-19 21:11:15 +0200
committerChristoph Lohmann <20h@r-36.net>2015-08-19 21:17:33 +0200
commit5d0c5be1028c67f3b499017c5c39019f4b1d8c10 (patch)
tree53b40f473b717e1903e5ab4bdf6fcc33fefdbedc /tabbed.c
parent55dc32b27b73c121cab18009bf087e95ef3d9c18 (diff)
downloadtabbed-5d0c5be1028c67f3b499017c5c39019f4b1d8c10.tar.gz
focus urgent tabs
With a lot of open tabs its quite annoying to toggle through all tabs until reaching the next one with an urgent hint set. Also with using Ctrl-[0..9] to get to the first 10 tabs, in some cases this may have disadvantages: 1. with more than 10 tabs, you can not use that quickselection 2. with a small tabbed window, you do not see every tab in the statusbar and therefore do not know which tab got urgent Therefore I created a function, which iterates over all currently managed tabs, focus the first urgent tab found or stays at the current tab, if there is no urgent-tab. By default, that function is mapped to Ctrl-u. Signed-off-by: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de> Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'tabbed.c')
-rw-r--r--tabbed.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tabbed.c b/tabbed.c
index b15f9cb..93c9d0f 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -104,6 +104,7 @@ static void expose(const XEvent *e);
static void focus(int c);
static void focusin(const XEvent *e);
static void focusonce(const Arg *arg);
+static void focusurgent(const Arg *);
static void fullscreen(const Arg *arg);
static char* getatom(int a);
static int getclient(Window w);
@@ -492,6 +493,17 @@ focusonce(const Arg *arg) {
}
void
+focusurgent(const Arg *args) {
+ int c;
+ for(c = (sel+1)%nclients; c != sel; c = (c+1)%nclients) {
+ if(clients[c]->urgent) {
+ focus(c);
+ return;
+ }
+ }
+}
+
+void
fullscreen(const Arg *arg) {
XEvent e;