Merge lp:~unity-team/compiz/trunk.fix_env into lp:~unity-team/compiz/trunk

Proposed by David Barth
Status: Merged
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~unity-team/compiz/trunk.fix_env
Merge into: lp:~unity-team/compiz/trunk
Diff against target: 33 lines (+8/-5)
1 file modified
src/screen.cpp (+8/-5)
To merge this branch: bzr merge lp:~unity-team/compiz/trunk.fix_env
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+56566@code.launchpad.net

This proposal supersedes a proposal from 2011-04-06.

Description of the change

This branch basically fixes the way we were botching the env for applications that we launch.

Because of the way compiz works, we need to ensure that the program is not just using the env as started by DISPLAY=:blah but actually the display and screen that compiz is running on (eg priv->displayString and priv->screenNum). However what we were doing in this case was replacing the display with 0.priv->screenNum every time which attempts to start any commands we wish to run on display :0. This is incorrect behaviour - it should reflect the display that compiz was actually started on.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

code looks code! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/screen.cpp'
--- src/screen.cpp 2011-03-30 12:28:16 +0000
+++ src/screen.cpp 2011-04-06 13:30:56 +0000
@@ -3468,22 +3468,25 @@
34683468
3469 if (fork () == 0)3469 if (fork () == 0)
3470 {3470 {
3471 size_t pos;3471 size_t pos;
3472 CompString env (priv->displayString);3472 CompString env (priv->displayString);
34733473
3474 setsid ();3474 setsid ();
34753475
3476 pos = env.find (':');3476 pos = env.find (':');
3477 if (pos != std::string::npos)3477 if (pos != std::string::npos)
3478 {3478 {
3479 if (env.find ('.', pos) != std::string::npos)3479 size_t pointPos = env.find ('.', pos);
3480
3481 if (pointPos != std::string::npos)
3480 {3482 {
3481 env.erase (env.find ('.', pos));3483 env.erase (pointPos);
3482 }3484 }
3483 else3485 else
3484 {3486 {
3487 unsigned int displayNum = atoi (env.substr (pos + 1).c_str ());
3485 env.erase (pos);3488 env.erase (pos);
3486 env.append (":0");3489 env.append (compPrintf (":%i", displayNum));
3487 }3490 }
3488 }3491 }
34893492

Subscribers

People subscribed via source and target branches

to all changes: