From f22d047d4139ef889e95aabd0103e11357193e5a Mon Sep 17 00:00:00 2001 From: Anselm R Garbe Date: Mon, 19 May 2008 15:05:46 +0100 Subject: make it easier for the user, if Xinerama support is given, always use the screen 0 as window area/bar area, everything else can be used for floating clients --- dwm.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 504b78b..4a8c2a9 100644 --- a/dwm.c +++ b/dwm.c @@ -39,6 +39,9 @@ #include #include #include +#ifdef XINERAMA +#include +#endif /* macros */ #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -1579,22 +1582,32 @@ updatebar(void) { void updategeom(void) { - unsigned int i; - -#ifdef CUSTOMGEOM /* define your own if you are Xinerama user */ - CUSTOMGEOM -#else - /* bar geometry*/ - bx = 0; - by = showbar ? (topbar ? 0 : sh - bh) : -bh; - bw = sw; + int i; +#ifdef XINERAMA + XineramaScreenInfo *info = NULL; /* window area geometry */ - wx = sx; - wy = showbar && topbar ? sy + bh : sy; - ww = sw; - wh = showbar ? sh - bh : sh; + if(XineramaIsActive(dpy)) { + info = XineramaQueryScreens(dpy, &i); + wx = info[0].x_org; + wy = showbar && topbar ? info[0].y_org + info[0].height + bh : info[0].y_org; + ww = info[0].width; + wh = showbar ? info[0].height - bh : info[0].height; + XFree(info); + } + else #endif + { + wx = sx; + wy = showbar && topbar ? sy + bh : sy; + ww = sw; + wh = showbar ? sh - bh : sh; + } + + /* bar geometry*/ + bx = wx; + by = showbar ? (topbar ? 0 : wy + wh) : -bh; + bw = ww; /* update layout geometries */ for(i = 0; i < LENGTH(layouts); i++) -- cgit v1.2.3-54-g00ecf