diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-29 13:38:58 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-29 13:38:58 +0000 |
commit | 30c60e30d728e5d19ddbaf29a4b1536deef5d18d (patch) | |
tree | b29e35d50c0548d0bd9c7bfc66b3825f9bf2e4a4 /src/Xinerama.c | |
parent | 49b23aa4b53349d2795a38058740f7f56e3cdb33 (diff) |
Add BC (backwards compat) to the old (pre-Standard) Xinerama ABI/API. IXEVIE-BASE
didn't go "all the way back" to the XPanoramiX API. Does anyone think
that's interesting?
Diffstat (limited to 'src/Xinerama.c')
-rw-r--r-- | src/Xinerama.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/Xinerama.c b/src/Xinerama.c index 575cb7e..93ea32c 100644 --- a/src/Xinerama.c +++ b/src/Xinerama.c @@ -1,4 +1,4 @@ -/* $XdotOrg$ */ +/* $XdotOrg: xc/lib/Xinerama/Xinerama.c,v 1.1.4.1 2003/12/18 19:29:12 kaleb Exp $ */ /************************************************************************* * * Copyright (c) 1999,2002 Hewlett-Packard Company @@ -152,6 +152,12 @@ Bool XineramaActive ( return active; } +#ifndef XNOXINERAMABC +Bool XineramaIsActive(Display *dpy) +{ + return XineramaActive(dpy, DefaultRootWindow(dpy)); +} +#endif Status XineramaGetData( @@ -208,6 +214,31 @@ Status XineramaGetData( return result; } +#ifndef XNOXINERAMABC +XineramaScreenInfo *XineramaQueryScreens(Display *dpy, int *number) +{ + XRectangle *screens = NULL; + if (XineramaGetData(dpy, DefaultRootWindow(dpy), &screens, number)) { + if (*number) { + XineramaScreenInfo *scrnInfo = NULL; + if ((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * *number))) { + int i; + for (i = 0; i < *number; i++) { + scrnInfo[i].screen_number = i; + scrnInfo[i].x_org = screens[i].x; + scrnInfo[i].y_org = screens[i].y; + scrnInfo[i].width = screens[i].width; + scrnInfo[i].height = screens[i].height; + } + XFree(screens); + return scrnInfo; + } + } + } + return NULL; +} +#endif + #define HINT_NAME "XINERAMA_CENTER_HINT" #define HINT_TYPE "INTEGER" |