Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_main.c e_remote_main.c 


Log Message:


force display to be [disp_name]:X.Y even if it is just [disp_name]:X

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_main.c    4 Jan 2005 01:57:20 -0000       1.20
+++ e_main.c    5 Jan 2005 09:09:03 -0000       1.21
@@ -63,7 +63,8 @@
    int nowelcome = 0;
    int after_restart = 0; 
    char buf[1024];
-
+   char *s;
+   
    /* for debugging by redirecting stdout of e to a log file to tail */
    setvbuf(stdout, NULL, _IONBF, 0);
    
@@ -89,7 +90,30 @@
             putenv(buf);
          }
      }
-  
+
+   /* fix up DISPLAY to be :N.0 if no .screen is in it */
+   s = getenv("DISPLAY");
+   if (s)
+     {
+       char *p;
+       
+       p = strrchr(s, ':');
+       if (!p)
+         {
+            snprintf(buf, sizeof(buf), "DISPLAY=%s:0.0", s);
+            putenv(buf);
+         }
+       else
+         {
+            p = strrchr(p, '.');
+            if (!p)
+              {
+                 snprintf(buf, sizeof(buf), "DISPLAY=%s.0", s);
+                 putenv(buf);
+              }
+         }
+     }
+   
    /* init edje and set it up in frozen mode */
    edje_init();
    edje_freeze();
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_remote_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_remote_main.c     23 Dec 2004 06:38:27 -0000      1.6
+++ e_remote_main.c     5 Jan 2005 09:09:03 -0000       1.7
@@ -53,6 +53,30 @@
 main(int argc, char **argv)
 {
    int i;
+   char *s, buf[1024];
+   
+   /* fix up DISPLAY to be :N.0 if no .screen is in it */
+   s = getenv("DISPLAY");
+   if (s)
+     {
+       char *p;
+       
+       p = strrchr(s, ':');
+       if (!p)
+         {
+            snprintf(buf, sizeof(buf), "DISPLAY=%s:0.0", s);
+            putenv(buf);
+         }
+       else
+         {
+            p = strrchr(p, '.');
+            if (!p)
+              {
+                 snprintf(buf, sizeof(buf), "DISPLAY=%s.0", s);
+                 putenv(buf);
+              }
+         }
+     }
    
    /* handle some command-line parameters */
    display_name = (const char *)getenv("DISPLAY");
@@ -100,7 +124,7 @@
    if (!_e_ipc_init())
      {
        printf("ERROR: Enlightenment_remote cannot set up the IPC socket.\n"
-              "Maybe try the '-display :0' option?\n");
+              "Maybe try the '-display :0.0' option?\n");
        exit(-1);
      }
 




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to