Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
minor fix
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
5c27113
..
32b7fc8
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-172,6
+172,7
@@
static void enternotify(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
static void focusin(XEvent *e);
static void expose(XEvent *e);
static void focus(Client *c);
static void focusin(XEvent *e);
+static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
static unsigned long getcolor(const char *colstr);
static Bool getrootpointer(int *x, int *y);
static void focusstack(const Arg *arg);
static unsigned long getcolor(const char *colstr);
static Bool getrootpointer(int *x, int *y);
@@
-207,6
+208,7
@@
static void showhide(Client *c);
static void sigchld(int signal);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
static void sigchld(int signal);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
+static void tagmon(const Arg *arg);
static int textnw(const char *text, unsigned int len);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static int textnw(const char *text, unsigned int len);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
@@
-231,10
+233,6
@@
static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
-#ifdef XINERAMA
-static void focusmon(const Arg *arg);
-static void tagmon(const Arg *arg);
-#endif /* XINERAMA */
/* variables */
static char stext[256];
/* variables */
static char stext[256];
@@
-309,9
+307,9
@@
applysizehints(Client *c, int *x, int *y, int *w, int *h) {
*h = MAX(1, *h);
if(*x > m->mx + m->mw)
*h = MAX(1, *h);
if(*x > m->mx + m->mw)
- *x = m->mw - WIDTH(c);
+ *x = m->m
x + m->m
w - WIDTH(c);
if(*y > m->my + m->mh)
if(*y > m->my + m->mh)
- *y = m->mh - HEIGHT(c);
+ *y = m->m
y + m->m
h - HEIGHT(c);
if(*x + *w + 2 * c->bw < m->mx)
*x = m->mx;
if(*y + *h + 2 * c->bw < m->my)
if(*x + *w + 2 * c->bw < m->mx)
*x = m->mx;
if(*y + *h + 2 * c->bw < m->my)
@@
-636,7
+634,6
@@
drawbar(Monitor *m) {
}
dc.x = 0;
}
dc.x = 0;
-#ifdef XINERAMA
if(mons->next) { /* more than a single monitor */
char buf[2];
buf[0] = m->screen_number + '0';
if(mons->next) { /* more than a single monitor */
char buf[2];
buf[0] = m->screen_number + '0';
@@
-645,7
+642,6
@@
drawbar(Monitor *m) {
drawtext(buf, selmon == m ? dc.sel : dc.norm, True);
dc.x += dc.w;
}
drawtext(buf, selmon == m ? dc.sel : dc.norm, True);
dc.x += dc.w;
}
-#endif /* XINERAMA */
m->btx = dc.x;
for(i = 0; i < LENGTH(tags); i++) {
dc.w = TEXTW(tags[i]);
m->btx = dc.x;
for(i = 0; i < LENGTH(tags); i++) {
dc.w = TEXTW(tags[i]);
@@
-803,7
+799,6
@@
focusin(XEvent *e) { /* there are some broken focus acquiring clients */
XSetInputFocus(dpy, selmon->sel->win, RevertToPointerRoot, CurrentTime);
}
XSetInputFocus(dpy, selmon->sel->win, RevertToPointerRoot, CurrentTime);
}
-#ifdef XINERAMA
void
focusmon(const Arg *arg) {
Monitor *m;
void
focusmon(const Arg *arg) {
Monitor *m;
@@
-814,7
+809,6
@@
focusmon(const Arg *arg) {
selmon = m;
focus(NULL);
}
selmon = m;
focus(NULL);
}
-#endif /* XINERAMA */
void
focusstack(const Arg *arg) {
void
focusstack(const Arg *arg) {
@@
-1201,7
+1195,7
@@
pointertomon(int x, int y) {
for(m = mons; m; m = m->next)
if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh))
return m;
for(m = mons; m; m = m->next)
if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh))
return m;
- return
mons
;
+ return
selmon
;
}
void
}
void
@@
-1376,6
+1370,7
@@
void
sendmon(Client *c, Monitor *m) {
if(c->mon == m)
return;
sendmon(Client *c, Monitor *m) {
if(c->mon == m)
return;
+ unfocus(c);
detach(c);
detachstack(c);
c->mon = m;
detach(c);
detachstack(c);
c->mon = m;
@@
-1529,7
+1524,6
@@
tag(const Arg *arg) {
}
}
}
}
-#ifdef XINERAMA
void
tagmon(const Arg *arg) {
Monitor *m;
void
tagmon(const Arg *arg) {
Monitor *m;
@@
-1538,7
+1532,6
@@
tagmon(const Arg *arg) {
return;
sendmon(selmon->sel, m);
}
return;
sendmon(selmon->sel, m);
}
-#endif /* XINERAMA */
int
textnw(const char *text, unsigned int len) {
int
textnw(const char *text, unsigned int len) {
@@
-1734,9
+1727,9
@@
updategeom(void) {
/* default monitor setup */
{
m->screen_number = 0;
/* default monitor setup */
{
m->screen_number = 0;
- m->wx = 0;
+ m->
mx = m->
wx = 0;
m->my = m->wy = 0;
m->my = m->wy = 0;
- m->ww = sw;
+ m->
mw = m->
ww = sw;
m->mh = m->wh = sh;
}
m->mh = m->wh = sh;
}
@@
-1765,7
+1758,7
@@
updategeom(void) {
/* select focused monitor */
cleanupmons();
/* select focused monitor */
cleanupmons();
- mons = newmons;
+
selmon =
mons = newmons;
selmon = wintomon(root);
}
selmon = wintomon(root);
}
@@
-1898,7
+1891,7
@@
wintomon(Window w) {
return m;
if((c = wintoclient(w)))
return c->mon;
return m;
if((c = wintoclient(w)))
return c->mon;
- return
mons
;
+ return
selmon
;
}
/* There's no way to check accesses to destroyed windows, thus those cases are
}
/* There's no way to check accesses to destroyed windows, thus those cases are