summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbCommands.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 820517d..6dee267 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -19,11 +19,12 @@
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.9 2003/06/22 14:16:25 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.10 2003/06/30 15:00:32 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
26#include "FbTk/Theme.hh" 26#include "FbTk/Theme.hh"
27#include "Screen.hh"
27 28
28#include <sys/types.h> 29#include <sys/types.h>
29#include <unistd.h> 30#include <unistd.h>
@@ -43,7 +44,16 @@ void ExecuteCmd::execute() {
43 std::string displaystring("DISPLAY="); 44 std::string displaystring("DISPLAY=");
44 displaystring += DisplayString(FbTk::App::instance()->display()); 45 displaystring += DisplayString(FbTk::App::instance()->display());
45 char intbuff[64]; 46 char intbuff[64];
46 sprintf(intbuff, "%d", m_screen_num); 47 int screen_num = m_screen_num;
48 if (screen_num < 0) {
49 if (Fluxbox::instance()->keyScreen() == 0)
50 screen_num = 0;
51 else
52 screen_num = Fluxbox::instance()->keyScreen()->screenNumber();
53 }
54
55 sprintf(intbuff, "%d", screen_num);
56
47 // remove last number of display and add screen num 57 // remove last number of display and add screen num
48 displaystring.erase(displaystring.size()-1); 58 displaystring.erase(displaystring.size()-1);
49 displaystring += intbuff; 59 displaystring += intbuff;