fixed urgency hint, though Xinerama integration is still ongoing

pull/1/head
Anselm R Garbe 17 years ago
parent e3c2d327f6
commit 59aa02a075
  1. 26
      dwm.c

26
dwm.c

@ -55,9 +55,9 @@
* #define BW sw * #define BW sw
* bh is calculated automatically and should be used for the * bh is calculated automatically and should be used for the
*/ */
#ifdef XINERAMA //#ifdef XINERAMA
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
#endif //#endif
/* macros */ /* macros */
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) #define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
@ -1474,9 +1474,9 @@ setup(void) {
int screens = 1; int screens = 1;
unsigned int i; unsigned int i;
XSetWindowAttributes wa; XSetWindowAttributes wa;
#ifdef XINERAMA //#ifdef XINERAMA
XineramaScreenInfo *info; XineramaScreenInfo *info;
#endif //#endif
/* init screen */ /* init screen */
screen = DefaultScreen(dpy); screen = DefaultScreen(dpy);
@ -1485,6 +1485,14 @@ setup(void) {
sy = 0; sy = 0;
sw = DisplayWidth(dpy, screen); sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen); sh = DisplayHeight(dpy, screen);
if(XineramaIsActive(dpy)) {
if((info = XineramaQueryScreens(dpy, &screens))) {
sx = info[0].x_org;
sy = info[0].y_org;
sw = info[0].width;
sh = info[0].height;
}
}
/* init atoms */ /* init atoms */
wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);
@ -1500,10 +1508,10 @@ setup(void) {
cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur);
ncols = 2; ncols = 2;
#ifdef XINERAMA #if 0
if(XineramaIsActive(dpy)) { if(XineramaIsActive(dpy)) {
if((info = XineramaQueryScreens(dpy, &screens))) { if((info = XineramaQueryScreens(dpy, &screens))) {
if(screens == 1) { if(screens >= 1) {
sx = info[0].x_org; sx = info[0].x_org;
sy = info[0].y_org; sy = info[0].y_org;
sw = info[0].width; sw = info[0].width;
@ -1523,14 +1531,12 @@ setup(void) {
} }
} }
else else
#endif
{ {
cols = emallocz(ncols * sizeof(Column)); cols = emallocz(ncols * sizeof(Column));
cols[0].x = sx; cols[0].x = sx;
cols[0].y = sy; cols[0].y = sy;
} }
#endif
/* init appearance */ /* init appearance */
dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR); dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR);
dc.norm[ColBG] = getcolor(NORMBGCOLOR); dc.norm[ColBG] = getcolor(NORMBGCOLOR);
@ -1864,6 +1870,8 @@ void
updatewmhints(Client *c) { updatewmhints(Client *c) {
XWMHints *wmh; XWMHints *wmh;
if(c == sel)
return;
if((wmh = XGetWMHints(dpy, c->win))) { if((wmh = XGetWMHints(dpy, c->win))) {
c->isurgent = (wmh->flags & XUrgencyHint) ? True : False; c->isurgent = (wmh->flags & XUrgencyHint) ? True : False;
XFree(wmh); XFree(wmh);

Loading…
Cancel
Save