[PATCH] Make runCommand() work with multiple screens.

Tomas Carnecky tom at dbservice.com
Fri Oct 12 04:10:19 PDT 2007


---
 src/screen.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 41f031e..9fa2a11 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3282,8 +3282,13 @@ runCommand (CompScreen *s,
 
     if (fork () == 0)
     {
+	size_t len = strlen (s->display->displayString);
+	char displayString[len + 16];
+	strcpy (displayString, s->display->displayString);
+	displayString[len - 1] = '0' + s->screenNum;
+
 	setsid ();
-	putenv (s->display->displayString);
+	putenv (displayString);
 	execl ("/bin/sh", "/bin/sh", "-c", command, NULL);
 	exit (0);
     }
-- 
1.5.3.4


--------------050603020208020104000903--


More information about the compiz mailing list