all repos — fluxbox @ 92f49bd8744037bc4812cdacde27b439b5353679

custom fork of the fluxbox windowmanager

fixed execute on right screen
fluxgen fluxgen
commit

92f49bd8744037bc4812cdacde27b439b5353679

parent

45fff3a4b21e60c93f8c4a6fa9601f7005dac4eb

5 files changed, 51 insertions(+), 33 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.3 2003/04/15 12:13:22 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.4 2003/04/28 00:34:59 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh"

@@ -33,13 +33,20 @@ using namespace std;

namespace FbCommands { -ExecuteCmd::ExecuteCmd(const std::string &cmd):m_cmd(cmd) { +ExecuteCmd::ExecuteCmd(const std::string &cmd, int screen_num):m_cmd(cmd), m_screen_num(screen_num) { } void ExecuteCmd::execute() { #ifndef __EMX__ if (! fork()) { + std::string displaystring("DISPLAY="); + displaystring += DisplayString(FbTk::App::instance()->display()); + char intbuff[64]; + sprintf(intbuff, "%d", m_screen_num); + // remove last number of display and add screen num + displaystring.erase(displaystring.size()-1); + displaystring += intbuff; setsid(); execl("/bin/sh", "/bin/sh", "-c", m_cmd.c_str(), 0); exit(0);
M src/FbCommands.hhsrc/FbCommands.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.hh,v 1.3 2003/04/16 13:33:18 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.4 2003/04/28 00:34:06 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox

@@ -35,10 +35,11 @@

/// executes a system command class ExecuteCmd: public FbTk::Command { public: - explicit ExecuteCmd(const std::string &cmd); + ExecuteCmd(const std::string &cmd, int screen_num); void execute(); private: std::string m_cmd; + const int m_screen_num; }; /// exit fluxbox
M src/RootTheme.ccsrc/RootTheme.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RootTheme.cc,v 1.1 2003/04/25 10:14:54 fluxgen Exp $ +// $Id: RootTheme.cc,v 1.2 2003/04/28 00:38:42 fluxgen Exp $ #include "RootTheme.hh"

@@ -54,10 +54,10 @@ void RootTheme::reconfigTheme() {

// override resource root command? if (m_screen_root_command == "") { // do root command - FbCommands::ExecuteCmd cmd(*m_root_command); + FbCommands::ExecuteCmd cmd(*m_root_command, screenNum()); cmd.execute(); } else { - FbCommands::ExecuteCmd cmd(m_screen_root_command); + FbCommands::ExecuteCmd cmd(m_screen_root_command, screenNum()); cmd.execute(); } }
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.139 2003/04/27 14:36:03 rathnor Exp $ +// $Id: Screen.cc,v 1.140 2003/04/28 00:36:50 fluxgen Exp $ #include "Screen.hh"

@@ -41,6 +41,7 @@ #include "SimpleCommand.hh"

#include "FbWinFrameTheme.hh" #include "MenuTheme.hh" #include "RootTheme.hh" +//#include "WinButtonTheme.hh" #include "FbCommands.hh" #include "BoolMenuItem.hh" #include "IntResMenuItem.hh"

@@ -493,21 +494,24 @@ };

BScreen::BScreen(ResourceManager &rm, const string &screenname, const string &altscreenname, - int scrn, int num_layers) : ScreenInfo(scrn), - m_clientlist_sig(*this), // client signal - m_workspacecount_sig(*this), // workspace count signal - m_workspacenames_sig(*this), // workspace names signal - m_currentworkspace_sig(*this), // current workspace signal - m_layermanager(num_layers), - cycling_focus(false), - cycling_last(0), - m_windowtheme(new FbWinFrameTheme(scrn)), - m_menutheme(new FbTk::MenuTheme(scrn)), - resource(rm, screenname, altscreenname), - m_root_theme(new - RootTheme(scrn, - *resource.rootcommand)), - m_toolbarhandler(0) { + int scrn, int num_layers) : + ScreenInfo(scrn), + m_clientlist_sig(*this), // client signal + m_workspacecount_sig(*this), // workspace count signal + m_workspacenames_sig(*this), // workspace names signal + m_currentworkspace_sig(*this), // current workspace signal + m_layermanager(num_layers), + cycling_focus(false), + cycling_last(0), + m_windowtheme(new FbWinFrameTheme(scrn)), + m_menutheme(new FbTk::MenuTheme(scrn)), + resource(rm, screenname, altscreenname), + m_root_theme(new + RootTheme(scrn, + *resource.rootcommand)), + // m_winbutton_theme(new WinButtonTheme(scrn)), + m_toolbarhandler(0) { + Display *disp = FbTk::App::instance()->display();

@@ -1328,13 +1332,15 @@ for (size_t i=0; i< dir->size(); ++i) {

//create new buttons FbTk::Button *newbutton = 0; if (win.isIconifiable() && (*dir)[i] == Fluxbox::MINIMIZE) { - newbutton = new WinButton(win, WinButton::MINIMIZE, + newbutton = new WinButton(win, //*m_winbutton_theme.get(), + WinButton::MINIMIZE, frame.titlebar(), 0, 0, 10, 10); newbutton->setOnClick(iconify_cmd); } else if (win.isMaximizable() && (*dir)[i] == Fluxbox::MAXIMIZE) { - newbutton = new WinButton(win, WinButton::MAXIMIZE, + newbutton = new WinButton(win, //*m_winbutton_theme.get(), + WinButton::MAXIMIZE, frame.titlebar(), 0, 0, 10, 10);

@@ -1343,7 +1349,8 @@ newbutton->setOnClick(maximize_horiz_cmd, 3);

newbutton->setOnClick(maximize_vert_cmd, 2); } else if (win.isClosable() && (*dir)[i] == Fluxbox::CLOSE) { - newbutton = new WinButton(win, WinButton::CLOSE, + newbutton = new WinButton(win, //*m_winbutton_theme.get(), + WinButton::CLOSE, frame.titlebar(), 0, 0, 10, 10);

@@ -1352,14 +1359,16 @@ #ifdef DEBUG

cerr<<__FILE__<<": Creating close button"<<endl; #endif // DEBUG } else if ((*dir)[i] == Fluxbox::STICK) { - WinButton *winbtn = new WinButton(win, WinButton::STICK, + WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(), + WinButton::STICK, frame.titlebar(), 0, 0, 10, 10); win.stateSig().attach(winbtn); winbtn->setOnClick(stick_cmd); newbutton = winbtn; } else if ((*dir)[i] == Fluxbox::SHADE) { - WinButton *winbtn = new WinButton(win, WinButton::SHADE, + WinButton *winbtn = new WinButton(win, // *m_winbutton_theme.get(), + WinButton::SHADE, frame.titlebar(), 0, 0, 10, 10); winbtn->setOnClick(shade_cmd);

@@ -1431,7 +1440,8 @@ return "";

} } -void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ignore_sticky) { +void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, + bool ignore_sticky) { if (w == 0) return;

@@ -1816,7 +1826,7 @@

if (defaultMenu) { FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd()); - FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm")); + FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", getScreenNumber())); m_rootmenu->setInternalMenu(); m_rootmenu->insert(i18n->getMessage( FBNLS::ScreenSet, FBNLS::Screenxterm,

@@ -1888,7 +1898,7 @@ "BScreen::parseMenuFile: [exec] error, "

"no menu label and/or command defined\n")); cerr<<"Row: "<<row<<endl; } else { - FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd)); + FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd, getScreenNumber())); FbTk::MacroCommand *exec_and_hide = new FbTk::MacroCommand(); exec_and_hide->add(hide_menu); exec_and_hide->add(exec_cmd);
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.122 2003/04/27 04:56:18 rathnor Exp $ +// $Id: fluxbox.cc,v 1.123 2003/04/28 00:37:38 fluxgen Exp $ #include "fluxbox.hh"

@@ -1188,7 +1188,7 @@ m_focused_window->detachClient(m_focused_window->winClient());

} break; case Keys::EXECUTE: { //execute command on keypress - FbCommands::ExecuteCmd cmd(m_key->getExecCommand()); + FbCommands::ExecuteCmd cmd(m_key->getExecCommand(), screen->getScreenNumber()); cmd.execute(); } break; case Keys::QUIT: