175 static void focusin(XEvent *e); |
175 static void focusin(XEvent *e); |
176 static void focusstack(const Arg *arg); |
176 static void focusstack(const Arg *arg); |
177 static Client *getclient(Window w); |
177 static Client *getclient(Window w); |
178 static unsigned long getcolor(const char *colstr); |
178 static unsigned long getcolor(const char *colstr); |
179 static Monitor *getmon(Window w); |
179 static Monitor *getmon(Window w); |
|
180 static Monitor *getmonn(unsigned int n); |
180 static Monitor *getmonxy(int x, int y); |
181 static Monitor *getmonxy(int x, int y); |
181 static Bool getrootpointer(int *x, int *y); |
182 static Bool getrootpointer(int *x, int *y); |
182 static long getstate(Window w); |
183 static long getstate(Window w); |
183 static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); |
184 static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); |
184 static void grabbuttons(Client *c, Bool focused); |
185 static void grabbuttons(Client *c, Bool focused); |
798 } |
799 } |
799 |
800 |
800 #ifdef XINERAMA |
801 #ifdef XINERAMA |
801 void |
802 void |
802 focusmon(const Arg *arg) { |
803 focusmon(const Arg *arg) { |
803 unsigned int i; |
804 Monitor *m; |
804 Monitor *m; |
805 |
805 |
806 if(!(m = getmonn(arg->ui)) || m == selmon) |
806 for(i = 0, m = mons; m; m = m->next, i++) |
807 return; |
807 if(i == arg->ui) { |
808 unfocus(selmon->sel); |
808 if(m == selmon) |
809 selmon = m; |
809 return; |
810 focus(NULL); |
810 unfocus(selmon->sel); |
|
811 selmon = m; |
|
812 focus(NULL); |
|
813 break; |
|
814 } |
|
815 } |
811 } |
816 #endif /* XINERAMA */ |
812 #endif /* XINERAMA */ |
817 |
813 |
818 void |
814 void |
819 focusstack(const Arg *arg) { |
815 focusstack(const Arg *arg) { |
1540 } |
1545 } |
1541 |
1546 |
1542 #ifdef XINERAMA |
1547 #ifdef XINERAMA |
1543 void |
1548 void |
1544 tagmon(const Arg *arg) { |
1549 tagmon(const Arg *arg) { |
1545 unsigned int i; |
|
1546 Client *c; |
|
1547 Monitor *m; |
1550 Monitor *m; |
1548 |
1551 |
1549 if(!(c = selmon->sel)) |
1552 if(!selmon->sel || !(m = getmonn(arg->ui))) |
1550 return; |
1553 return; |
1551 for(i = 0, m = mons; m; m = m->next, i++) |
1554 sendmon(selmon->sel, m); |
1552 if(i == arg->ui) { |
|
1553 sendmon(c, m); |
|
1554 break; |
|
1555 } |
|
1556 } |
1555 } |
1557 #endif /* XINERAMA */ |
1556 #endif /* XINERAMA */ |
1558 |
1557 |
1559 int |
1558 int |
1560 textnw(const char *text, unsigned int len) { |
1559 textnw(const char *text, unsigned int len) { |