summaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorJim Ramsay <i.am@jimramsay.com>2009-10-14 01:05:49 (GMT)
committerJim Ramsay <i.am@jimramsay.com>2009-10-14 01:05:49 (GMT)
commit839ea523164caecd8c779e60539b78c2a748a81f (patch)
tree0019d04f27a1a258bc7a900e3cf77b916dca6493 /src/FbCommands.cc
parent4d3aa646c1d1d1de4fdb31f938f6ea62fd5dd21e (diff)
parent8def80cec337a986b762cdbb5e2555c6da809353 (diff)
downloadfluxbox_lack-argb.zip
fluxbox_lack-argb.tar.bz2
Merge branch 'master' into argbtesting/argbargb
Conflicts: src/FbTk/FbWindow.cc
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 3c69386..f050669 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -144,7 +144,6 @@ int ExecuteCmd::run() {
144 144
145 string displaystring("DISPLAY="); 145 string displaystring("DISPLAY=");
146 displaystring += DisplayString(FbTk::App::instance()->display()); 146 displaystring += DisplayString(FbTk::App::instance()->display());
147 char intbuff[64];
148 int screen_num = m_screen_num; 147 int screen_num = m_screen_num;
149 if (screen_num < 0) { 148 if (screen_num < 0) {
150 if (Fluxbox::instance()->mouseScreen() == 0) 149 if (Fluxbox::instance()->mouseScreen() == 0)
@@ -153,8 +152,6 @@ int ExecuteCmd::run() {
153 screen_num = Fluxbox::instance()->mouseScreen()->screenNumber(); 152 screen_num = Fluxbox::instance()->mouseScreen()->screenNumber();
154 } 153 }
155 154
156 sprintf(intbuff, "%d", screen_num);
157
158 // get shell path from the environment 155 // get shell path from the environment
159 // this process exits immediately, so we don't have to worry about memleaks 156 // this process exits immediately, so we don't have to worry about memleaks
160 const char *shell = getenv("SHELL"); 157 const char *shell = getenv("SHELL");
@@ -163,7 +160,7 @@ int ExecuteCmd::run() {
163 160
164 // remove last number of display and add screen num 161 // remove last number of display and add screen num
165 displaystring.erase(displaystring.size()-1); 162 displaystring.erase(displaystring.size()-1);
166 displaystring += intbuff; 163 displaystring += FbTk::StringUtil::number2String(screen_num);
167 164
168 setsid(); 165 setsid();
169 putenv(const_cast<char *>(displaystring.c_str())); 166 putenv(const_cast<char *>(displaystring.c_str()));
@@ -466,7 +463,7 @@ void SetResourceValueDialogCmd::execute() {
466 463
467 FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue "); 464 FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue ");
468 win->show(); 465 win->show();
469}; 466}
470 467
471REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(bindkey, FbCommands::BindKeyCmd, void); 468REGISTER_UNTRUSTED_COMMAND_WITH_ARGS(bindkey, FbCommands::BindKeyCmd, void);
472 469