/* gcc -lX11 -lXinerama -o xinerama_dump xinerama_dump.c */
/* http://wiki.cyberleo.net/wiki/CyberLeo/COPYRIGHT?version=3 */

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xinerama.h>
#include <stdio.h>

int main(int argc, char ** argv) {
  Display *display;
  int xinerama_active;

  if (!(display = XOpenDisplay(NULL))) {
    fprintf(stderr, "XOpenDispay failed\n");
    return(1);
  }

  if (xinerama_active = XineramaIsActive(display)) {
    int xinerama_iter, xinerama_count;
    XineramaScreenInfo * xinerama_info = XineramaQueryScreens(display, & xinerama_count);
    for (xinerama_iter = 0; xinerama_iter < xinerama_count; xinerama_iter++) {
      XineramaScreenInfo this = xinerama_info[xinerama_iter];
      printf("index=%u screen=%u width=%hu height=%hu x_org=%hu y_org=%hu\n",
        xinerama_iter, this.screen_number, this.width, this.height,
        this.x_org, this.y_org
      );
    }
    XFree(xinerama_info);
  }

  XCloseDisplay(display);
  return(xinerama_active);
}
all: xinerama_dump

xinerama_dump: xinerama_dump.c
        gcc -lX11 -lXinerama -o xinerama_dump xinerama_dump.c

clean:
        rm -f xinerama_dump

.PHONY: clean

PHP Warning

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead:"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead"

Warning: "preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead:"