aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-28 00:38:42 (GMT)
committerfluxgen <fluxgen>2003-04-28 00:38:42 (GMT)
commit92f49bd8744037bc4812cdacde27b439b5353679 (patch)
tree401546faa2a08196d5e58f6fce156ee296288f22 /src/FbCommands.cc
parent45fff3a4b21e60c93f8c4a6fa9601f7005dac4eb (diff)
downloadfluxbox-92f49bd8744037bc4812cdacde27b439b5353679.zip
fluxbox-92f49bd8744037bc4812cdacde27b439b5353679.tar.bz2
fixed execute on right screen
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc11
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
34namespace FbCommands { 34namespace FbCommands {
35 35
36ExecuteCmd::ExecuteCmd(const std::string &cmd):m_cmd(cmd) { 36ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) {
37 37
38} 38}
39 39
40void ExecuteCmd::execute() { 40void 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);