diff options
author | oga | 2008-09-29 23:16:46 +0000 |
---|---|---|
committer | oga | 2008-09-29 23:16:46 +0000 |
commit | a45b63cfb2ae8afa0152a8e8ebc59e605cf09713 (patch) | |
tree | 274e39637d074c40f57c08c158a2ee0043392712 /screen.c | |
parent | 9809202df5c965b7710ef1770d36c25c586e4249 (diff) | |
download | cwm-a45b63cfb2ae8afa0152a8e8ebc59e605cf09713.tar.gz |
Xinerama and XRandR dual head support for cwm(1). Now we detect the xrandr
reconfiguration events and change our sizes depending on that. We also detect
the xinerama screens for maximize, vertmaximize and initial window placement.
This could be improved by automatically resizing maximized windows when
the screen resolution changes and by moving windows that would be hidden
into visible space. Said changes will come shortly.
Tested by many. matthieu@ didn't oppose.
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: screen.c,v 1.10 2008/09/22 14:28:04 oga Exp $ + * $Id: screen.c,v 1.11 2008/09/29 23:16:46 oga Exp $ */ #include "headers.h" @@ -67,3 +67,28 @@ screen_updatestackingorder(void) XFree(wins); } + +void +screen_init_xinerama(struct screen_ctx *sc) +{ + XineramaScreenInfo *info; + int no, fake; + + if (HasXinerama == 0 || XineramaIsActive(X_Dpy) == 0) { + HasXinerama = 0; + sc->xinerama_no = 0; + } + + info = XineramaQueryScreens(X_Dpy, &no); + if (info == NULL) { + /*is xinerama is actually off, instead of a malloc failure? */ + if (sc->xinerama == NULL) + HasXinerama = NULL; + return; + } + + if (sc->xinerama != NULL) + XFree(sc->xinerama); + sc->xinerama = info; + sc->xinerama_no = no; +} |