aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent45fff3a4b21e60c93f8c4a6fa9601f7005dac4eb (diff)
downloadfluxbox_paul-92f49bd8744037bc4812cdacde27b439b5353679.zip
fluxbox_paul-92f49bd8744037bc4812cdacde27b439b5353679.tar.bz2
fixed execute on right screen
Diffstat (limited to 'src')
-rw-r--r--src/FbCommands.cc11
-rw-r--r--src/FbCommands.hh5
-rw-r--r--src/RootTheme.cc6
-rw-r--r--src/Screen.cc58
-rw-r--r--src/fluxbox.cc4
5 files changed, 51 insertions, 33 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);
diff --git a/src/FbCommands.hh b/src/FbCommands.hh
index 6901d6f..1056b6f 100644
--- a/src/FbCommands.hh
+++ b/src/FbCommands.hh
@@ -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.hh,v 1.3 2003/04/16 13:33:18 fluxgen Exp $ 22// $Id: FbCommands.hh,v 1.4 2003/04/28 00:34:06 fluxgen Exp $
23 23
24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox 24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox
25 25
@@ -35,10 +35,11 @@ namespace FbCommands {
35/// executes a system command 35/// executes a system command
36class ExecuteCmd: public FbTk::Command { 36class ExecuteCmd: public FbTk::Command {
37public: 37public:
38 explicit ExecuteCmd(const std::string &cmd); 38 ExecuteCmd(const std::string &cmd, int screen_num);
39 void execute(); 39 void execute();
40private: 40private:
41 std::string m_cmd; 41 std::string m_cmd;
42 const int m_screen_num;
42}; 43};
43 44
44/// exit fluxbox 45/// exit fluxbox
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index a652854..617cd8d 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.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: RootTheme.cc,v 1.1 2003/04/25 10:14:54 fluxgen Exp $ 22// $Id: RootTheme.cc,v 1.2 2003/04/28 00:38:42 fluxgen Exp $
23 23
24#include "RootTheme.hh" 24#include "RootTheme.hh"
25 25
@@ -54,10 +54,10 @@ void RootTheme::reconfigTheme() {
54 // override resource root command? 54 // override resource root command?
55 if (m_screen_root_command == "") { 55 if (m_screen_root_command == "") {
56 // do root command 56 // do root command
57 FbCommands::ExecuteCmd cmd(*m_root_command); 57 FbCommands::ExecuteCmd cmd(*m_root_command, screenNum());
58 cmd.execute(); 58 cmd.execute();
59 } else { 59 } else {
60 FbCommands::ExecuteCmd cmd(m_screen_root_command); 60 FbCommands::ExecuteCmd cmd(m_screen_root_command, screenNum());
61 cmd.execute(); 61 cmd.execute();
62 } 62 }
63} 63}
diff --git a/src/Screen.cc b/src/Screen.cc
index 8712fa3..00615e6 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.139 2003/04/27 14:36:03 rathnor Exp $ 25// $Id: Screen.cc,v 1.140 2003/04/28 00:36:50 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -41,6 +41,7 @@
41#include "FbWinFrameTheme.hh" 41#include "FbWinFrameTheme.hh"
42#include "MenuTheme.hh" 42#include "MenuTheme.hh"
43#include "RootTheme.hh" 43#include "RootTheme.hh"
44//#include "WinButtonTheme.hh"
44#include "FbCommands.hh" 45#include "FbCommands.hh"
45#include "BoolMenuItem.hh" 46#include "BoolMenuItem.hh"
46#include "IntResMenuItem.hh" 47#include "IntResMenuItem.hh"
@@ -493,21 +494,24 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
493 494
494BScreen::BScreen(ResourceManager &rm, 495BScreen::BScreen(ResourceManager &rm,
495 const string &screenname, const string &altscreenname, 496 const string &screenname, const string &altscreenname,
496 int scrn, int num_layers) : ScreenInfo(scrn), 497 int scrn, int num_layers) :
497 m_clientlist_sig(*this), // client signal 498 ScreenInfo(scrn),
498 m_workspacecount_sig(*this), // workspace count signal 499 m_clientlist_sig(*this), // client signal
499 m_workspacenames_sig(*this), // workspace names signal 500 m_workspacecount_sig(*this), // workspace count signal
500 m_currentworkspace_sig(*this), // current workspace signal 501 m_workspacenames_sig(*this), // workspace names signal
501 m_layermanager(num_layers), 502 m_currentworkspace_sig(*this), // current workspace signal
502 cycling_focus(false), 503 m_layermanager(num_layers),
503 cycling_last(0), 504 cycling_focus(false),
504 m_windowtheme(new FbWinFrameTheme(scrn)), 505 cycling_last(0),
505 m_menutheme(new FbTk::MenuTheme(scrn)), 506 m_windowtheme(new FbWinFrameTheme(scrn)),
506 resource(rm, screenname, altscreenname), 507 m_menutheme(new FbTk::MenuTheme(scrn)),
507 m_root_theme(new 508 resource(rm, screenname, altscreenname),
508 RootTheme(scrn, 509 m_root_theme(new
509 *resource.rootcommand)), 510 RootTheme(scrn,
510 m_toolbarhandler(0) { 511 *resource.rootcommand)),
512 // m_winbutton_theme(new WinButtonTheme(scrn)),
513 m_toolbarhandler(0) {
514
511 515
512 Display *disp = FbTk::App::instance()->display(); 516 Display *disp = FbTk::App::instance()->display();
513 517
@@ -1328,13 +1332,15 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1328 //create new buttons 1332 //create new buttons
1329 FbTk::Button *newbutton = 0; 1333 FbTk::Button *newbutton = 0;
1330 if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) { 1334 if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) {
1331 newbutton = new WinButton(win, WinButton::MINIMIZE, 1335 newbutton = new WinButton(win, //*m_winbutton_theme.get(),
1336 WinButton::MINIMIZE,
1332 frame.titlebar(), 1337 frame.titlebar(),
1333 0, 0, 10, 10); 1338 0, 0, 10, 10);
1334 newbutton->setOnClick(iconify_cmd); 1339 newbutton->setOnClick(iconify_cmd);
1335 1340
1336 } else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) { 1341 } else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) {
1337 newbutton = new WinButton(win, WinButton::MAXIMIZE, 1342 newbutton = new WinButton(win, //*m_winbutton_theme.get(),
1343 WinButton::MAXIMIZE,
1338 frame.titlebar(), 1344 frame.titlebar(),
1339 0, 0, 10, 10); 1345 0, 0, 10, 10);
1340 1346
@@ -1343,7 +1349,8 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1343 newbutton->setOnClick(maximize_vert_cmd, 2); 1349 newbutton->setOnClick(maximize_vert_cmd, 2);
1344 1350
1345 } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) { 1351 } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) {
1346 newbutton = new WinButton(win, WinButton::CLOSE, 1352 newbutton = new WinButton(win, //*m_winbutton_theme.get(),
1353 WinButton::CLOSE,
1347 frame.titlebar(), 1354 frame.titlebar(),
1348 0, 0, 10, 10); 1355 0, 0, 10, 10);
1349 1356
@@ -1352,14 +1359,16 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
1352 cerr<<__FILE__<<": Creating close button"<<endl; 1359 cerr<<__FILE__<<": Creating close button"<<endl;
1353#endif // DEBUG 1360#endif // DEBUG
1354 } else if ((*dir)[i] == Fluxbox::STICK) { 1361 } else if ((*dir)[i] == Fluxbox::STICK) {
1355 WinButton *winbtn = new WinButton(win, WinButton::STICK, 1362 WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(),
1363 WinButton::STICK,
1356 frame.titlebar(), 1364 frame.titlebar(),
1357 0, 0, 10, 10); 1365 0, 0, 10, 10);
1358 win.stateSig().attach(winbtn); 1366 win.stateSig().attach(winbtn);
1359 winbtn->setOnClick(stick_cmd); 1367 winbtn->setOnClick(stick_cmd);
1360 newbutton = winbtn; 1368 newbutton = winbtn;
1361 } else if ((*dir)[i] == Fluxbox::SHADE) { 1369 } else if ((*dir)[i] == Fluxbox::SHADE) {
1362 WinButton *winbtn = new WinButton(win, WinButton::SHADE, 1370 WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(),
1371 WinButton::SHADE,
1363 frame.titlebar(), 1372 frame.titlebar(),
1364 0, 0, 10, 10); 1373 0, 0, 10, 10);
1365 winbtn->setOnClick(shade_cmd); 1374 winbtn->setOnClick(shade_cmd);
@@ -1431,7 +1440,8 @@ string BScreen::getNameOfWorkspace(unsigned int workspace) const {
1431 } 1440 }
1432} 1441}
1433 1442
1434void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) { 1443void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
1444 bool ignore_sticky) {
1435 if (w == 0) 1445 if (w == 0)
1436 return; 1446 return;
1437 1447
@@ -1816,7 +1826,7 @@ void BScreen::initMenu() {
1816 if (defaultMenu) { 1826 if (defaultMenu) {
1817 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); 1827 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd());
1818 FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd()); 1828 FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd());
1819 FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm")); 1829 FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", getScreenNumber()));
1820 m_rootmenu->setInternalMenu(); 1830 m_rootmenu->setInternalMenu();
1821 m_rootmenu->insert(i18n->getMessage( 1831 m_rootmenu->insert(i18n->getMessage(
1822 FBNLS::ScreenSet, FBNLS::Screenxterm, 1832 FBNLS::ScreenSet, FBNLS::Screenxterm,
@@ -1888,7 +1898,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
1888 "no menu label and/or command defined\n")); 1898 "no menu label and/or command defined\n"));
1889 cerr<<"Row: "<<row<<endl; 1899 cerr<<"Row: "<<row<<endl;
1890 } else { 1900 } else {
1891 FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd)); 1901 FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd, getScreenNumber()));
1892 FbTk::MacroCommand *exec_and_hide = new FbTk::MacroCommand(); 1902 FbTk::MacroCommand *exec_and_hide = new FbTk::MacroCommand();
1893 exec_and_hide->add(hide_menu); 1903 exec_and_hide->add(hide_menu);
1894 exec_and_hide->add(exec_cmd); 1904 exec_and_hide->add(exec_cmd);
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 5de7d8d..15f3a63 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.122 2003/04/27 04:56:18 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.123 2003/04/28 00:37:38 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -1188,7 +1188,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1188 } 1188 }
1189 break; 1189 break;
1190 case Keys::EXECUTE: { //execute command on keypress 1190 case Keys::EXECUTE: { //execute command on keypress
1191 FbCommands::ExecuteCmd cmd(m_key->getExecCommand()); 1191 FbCommands::ExecuteCmd cmd(m_key->getExecCommand(), screen->getScreenNumber());
1192 cmd.execute(); 1192 cmd.execute();
1193 } break; 1193 } break;
1194 case Keys::QUIT: 1194 case Keys::QUIT: