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
1=== modified file 'src/screen.cpp'
2--- src/screen.cpp 2011-03-30 12:28:16 +0000
3+++ src/screen.cpp 2011-04-06 13:30:56 +0000
4@@ -3468,22 +3468,25 @@
5
6 if (fork () == 0)
7 {
8- size_t pos;
9- CompString env (priv->displayString);
10+ size_t pos;
11+ CompString env (priv->displayString);
12
13 setsid ();
14
15 pos = env.find (':');
16 if (pos != std::string::npos)
17 {
18- if (env.find ('.', pos) != std::string::npos)
19+ size_t pointPos = env.find ('.', pos);
20+
21+ if (pointPos != std::string::npos)
22 {
23- env.erase (env.find ('.', pos));
24+ env.erase (pointPos);
25 }
26 else
27 {
28+ unsigned int displayNum = atoi (env.substr (pos + 1).c_str ());
29 env.erase (pos);
30- env.append (":0");
31+ env.append (compPrintf (":%i", displayNum));
32 }
33 }
34

Subscribers

People subscribed via source and target branches

to all changes: