Mesa (mesa_7_5_branch): xdemos: Fix xdemos which default to using display : 0.0 to default to $DISPLAY

Brian Paul brianp at kemper.freedesktop.org
Tue Jun 30 19:59:26 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 57955451f80c64f70e369508705ae95a515d18d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=57955451f80c64f70e369508705ae95a515d18d8

Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Jun 21 11:58:25 2009 +0100

xdemos: Fix xdemos which default to using display :0.0 to default to $DISPLAY

Fix xdemos which default to using display :0.0 to default to $DISPLAY,
this is kind of irritating when testing on a display other than :0.0

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

---

 progs/xdemos/glthreads.c      |    4 ++--
 progs/xdemos/glxheads.c       |    3 ++-
 progs/xdemos/glxswapcontrol.c |    2 +-
 progs/xdemos/opencloseopen.c  |    2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/progs/xdemos/glthreads.c b/progs/xdemos/glthreads.c
index b90e6b4..ea54748 100644
--- a/progs/xdemos/glthreads.c
+++ b/progs/xdemos/glthreads.c
@@ -26,7 +26,7 @@
  *  -p                       Open a display connection for each thread
  *  -l                       Enable application-side locking
  *  -n <num threads>         Number of threads to create (default is 2)
- *  -display <display name>  Specify X display (default is :0.0)
+ *  -display <display name>  Specify X display (default is $DISPLAY)
  *  -t                       Use texture mapping
  *
  * Brian Paul  20 July 2000
@@ -573,7 +573,7 @@ usage(void)
 int
 main(int argc, char *argv[])
 {
-   char *displayName = ":0.0";
+   char *displayName = NULL;
    int numThreads = 2;
    Display *dpy = NULL;
    int i;
diff --git a/progs/xdemos/glxheads.c b/progs/xdemos/glxheads.c
index b3290e9..b1a63d3 100644
--- a/progs/xdemos/glxheads.c
+++ b/progs/xdemos/glxheads.c
@@ -267,7 +267,8 @@ main(int argc, char *argv[])
       printf("  glxheads xdisplayname ...\n");
       printf("Example:\n");
       printf("  glxheads :0 mars:0 venus:1\n");
-      h = AddHead(":0");
+
+      h = AddHead(XDisplayName(NULL));
       if (h)
          PrintInfo(h);
    }
diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c
index 2c51801..5a5d084 100644
--- a/progs/xdemos/glxswapcontrol.c
+++ b/progs/xdemos/glxswapcontrol.c
@@ -759,7 +759,7 @@ main(int argc, char *argv[])
    Display *dpy;
    Window win;
    GLXContext ctx;
-   char *dpyName = ":0";
+   char *dpyName = NULL;
    int swap_interval = 1;
    GLboolean do_swap_interval = GL_FALSE;
    GLboolean force_get_rate = GL_FALSE;
diff --git a/progs/xdemos/opencloseopen.c b/progs/xdemos/opencloseopen.c
index 0b8d061..7560960 100644
--- a/progs/xdemos/opencloseopen.c
+++ b/progs/xdemos/opencloseopen.c
@@ -158,7 +158,7 @@ main(int argc, char *argv[])
    Display *dpy;
    Window win;
    GLXContext ctx;
-   char *dpyName = ":0";
+   char *dpyName = NULL;
    int i;
 
    for (i = 1; i < argc; i++) {




More information about the mesa-commit mailing list