Hi,

I'm new to LXDE and I've found a strange behavior with the DISPLAY environment variable.

On my system, when I run lxterminal from lxpanel and type "echo $DISPLAY", I get ":0". But, if I run lxterminal from PCManFm and type "echo $DISPLAY", I get ":0.0".

As a result, lxterminal is not limited to a single process as it should be, there is two
different sockets created in /tmp

Attached patch fixes that trouble, thought , I'm not sure if it's the correct way to do it. Also, I have no idea why $DISPLAY is different from lxpanel or from PCManFm, any
information would be appreciated.

Regards,
AF.

--
Axel FILMORE

diff -rup upstreamsrc/lxterminal//src/unixsocket.c localsrc/lxterminal/src/unixsocket.c
--- upstreamsrc/lxterminal//src/unixsocket.c	2011-12-19 23:31:54.000000000 +0100
+++ localsrc/lxterminal/src/unixsocket.c	2011-12-29 17:22:47.651655427 +0100
@@ -116,7 +116,16 @@ gboolean lxterminal_socket_initialize(LX
      * This function returns TRUE if this process should keep running and FALSE if it should exit. */
 
     /* Formulate the path for the Unix domain socket. */
-    gchar * socket_path = g_strdup_printf("/tmp/.lxterminal-socket%s-%s", gdk_get_display(), g_get_user_name());
+    
+    gchar * display = gdk_get_display();
+    int dpynum = 0;
+    if (display)
+    {
+        const char* p = strrchr(display, ':');
+        if (p) dpynum = atoi(p + 1);
+    }
+
+    gchar * socket_path = g_strdup_printf("/tmp/.lxterminal-socket-%d-%s", dpynum, g_get_user_name());
 
     /* Create socket. */
     int fd = socket(PF_UNIX, SOCK_STREAM, 0);
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list

Reply via email to