diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-04-21 17:19:06 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-04-21 17:21:56 +0100 |
commit | 10d8a5f8ec0e3d6f76c83195f185cfcc193a32a5 (patch) | |
tree | a8a27840ddc3f886435ea3a369492990d0175a33 /src | |
parent | 7c7892b5e05295c09ed361396393dbcd357f34f7 (diff) |
Respect standard DISPLAY environment variable in showvis.
showvis was hardcoded to use :0 in the absence of the -display
command line option, which can be quite misleading.
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/showvis/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/showvis/main.cpp b/src/tools/showvis/main.cpp index 7d5ca7b..bfa1fe0 100644 --- a/src/tools/showvis/main.cpp +++ b/src/tools/showvis/main.cpp @@ -50,7 +50,7 @@ main(int argc, char* argv[]) { bool canonical = false; # if defined(__X11__) - string displayName(":0"); + char* displayName = NULL; # endif for (int i = 1; i < argc; ++i) { @@ -88,10 +88,10 @@ main(int argc, char* argv[]) { # endif legacyMethod: - Display* dpy = XOpenDisplay(displayName.c_str()); + Display* dpy = XOpenDisplay(displayName); if (!dpy) { - cerr << "can't open display " << displayName << "\n"; + cerr << "can't open display " << XDisplayName(displayName) << "\n"; exit(2); } |