diff options
author | fluxgen <fluxgen> | 2003-04-28 00:38:42 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-28 00:38:42 (GMT) |
commit | 92f49bd8744037bc4812cdacde27b439b5353679 (patch) | |
tree | 401546faa2a08196d5e58f6fce156ee296288f22 /src/FbCommands.cc | |
parent | 45fff3a4b21e60c93f8c4a6fa9601f7005dac4eb (diff) | |
download | fluxbox-92f49bd8744037bc4812cdacde27b439b5353679.zip fluxbox-92f49bd8744037bc4812cdacde27b439b5353679.tar.bz2 |
fixed execute on right screen
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r-- | src/FbCommands.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 83663fb..0d7d7b6 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbCommands.cc,v 1.3 2003/04/15 12:13:22 fluxgen Exp $ | 22 | // $Id: FbCommands.cc,v 1.4 2003/04/28 00:34:59 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbCommands.hh" | 24 | #include "FbCommands.hh" |
25 | #include "fluxbox.hh" | 25 | #include "fluxbox.hh" |
@@ -33,13 +33,20 @@ using namespace std; | |||
33 | 33 | ||
34 | namespace FbCommands { | 34 | namespace FbCommands { |
35 | 35 | ||
36 | ExecuteCmd::ExecuteCmd(const std::string &cmd):m_cmd(cmd) { | 36 | ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) { |
37 | 37 | ||
38 | } | 38 | } |
39 | 39 | ||
40 | void ExecuteCmd::execute() { | 40 | void ExecuteCmd::execute() { |
41 | #ifndef __EMX__ | 41 | #ifndef __EMX__ |
42 | if (! fork()) { | 42 | if (! fork()) { |
43 | std::string displaystring("DISPLAY="); | ||
44 | displaystring += DisplayString(FbTk::App::instance()->display()); | ||
45 | char intbuff[64]; | ||
46 | sprintf(intbuff, "%d", m_screen_num); | ||
47 | // remove last number of display and add screen num | ||
48 | displaystring.erase(displaystring.size()-1); | ||
49 | displaystring += intbuff; | ||
43 | setsid(); | 50 | setsid(); |
44 | execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0); | 51 | execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0); |
45 | exit(0); | 52 | exit(0); |