summaryrefslogtreecommitdiffstats
path: root/Tests/X11/X11.c
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/X11/X11.c')
-rw-r--r--Tests/X11/X11.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/Tests/X11/X11.c b/Tests/X11/X11.c
index bac0836..8ec6adc 100644
--- a/Tests/X11/X11.c
+++ b/Tests/X11/X11.c
@@ -23,20 +23,20 @@ char **argv;
int i;
char text[10];
int done;
+ char* display = ":0";
- mydisplay=XOpenDisplay("");
-/*
- myscreen=DefaultScreen(mydisplay);
- myforeground=BlackPixel(mydisplay, myscreen);
-
- mywindow=XCreateSimpleWindow(mydisplay,
- DefaultRootWindow(mydisplay),
- myhint.x, myhint.y, myhint.width,
- myhint.height, 5,
- myforeground, mybackground );
- XDestroyWindow(mydisplay, mywindow);
-*/
- XCloseDisplay(mydisplay);
+
+ if ( getenv("DISPLAY") )
+ {
+ display = getenv("DISPLAY");
+ }
+
+ mydisplay=XOpenDisplay(display);
+ if ( mydisplay )
+ {
+ printf("Opened...\n");
+ XCloseDisplay(mydisplay);
+ }
exit(0);
}