Fix 'dist' target in Makefile
[notion/jeffpc.git] / mod_xinerama / ls_xinerama.c
blob75e45e5fb73d33614f0090e8f87ada502845416a
1 #include <X11/Xlib.h>
2 #include <X11/extensions/Xinerama.h>
3 #include <stdbool.h>
4 #include <stdio.h>
6 int main() {
7 Display *dpy = XOpenDisplay(NULL);
8 int xinerama_event_base;
9 int xinerama_error_base;
10 bool xinerama_ready = XineramaQueryExtension(dpy,&xinerama_event_base, &xinerama_error_base);
12 fprintf(stdout, "Basic Xinerama screen information - for all the details run 'xdpyinfo -ext XINERAMA'\n");
14 if (!xinerama_ready)
15 fprintf(stderr, "No Xinerama support detected, mod_xinerama won't do anything.");
16 else {
17 int nRects,i;
18 XineramaScreenInfo* sInfo = XineramaQueryScreens(dpy, &nRects);
19 for(i = 0 ; i < nRects ; ++i) {
20 fprintf(stdout, "Screen %d: %dx%d+%d+%d\n", i, sInfo[i].width, sInfo[i].height, sInfo[i].x_org, sInfo[i].y_org);
24 return 0;