aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am13
-rw-r--r--src/MenuCreator.cc3
-rw-r--r--src/RootCmdMenuItem.cc8
-rw-r--r--src/RootCmdMenuItem.hh2
-rw-r--r--src/RootTheme.cc9
-rw-r--r--src/Workspace.cc2
-rw-r--r--src/fluxbox.cc23
-rw-r--r--src/fluxbox.hh3
8 files changed, 39 insertions, 24 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 0f3395e..f66ddc9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,6 +28,8 @@ DEFAULT_MENU=@DEFAULT_MENU@
28DEFAULT_STYLE=$(pkgdatadir)/styles/Clean 28DEFAULT_STYLE=$(pkgdatadir)/styles/Clean
29DEFAULT_KEYSFILE=@DEFAULT_KEYS@ 29DEFAULT_KEYSFILE=@DEFAULT_KEYS@
30DEFAULT_INITFILE=@DEFAULT_INIT@ 30DEFAULT_INITFILE=@DEFAULT_INIT@
31PROGRAM_PREFIX=@program_prefix@
32PROGRAM_SUFFIX=@program_suffix@
31 33
32AM_CPPFLAGS=-I$(srcdir)/FbTk 34AM_CPPFLAGS=-I$(srcdir)/FbTk
33 35
@@ -37,14 +39,25 @@ CONFIG_CLEAN_FILES = defaults.hh
37defaults.hh: Makefile 39defaults.hh: Makefile
38 @( \ 40 @( \
39 echo '// This file is generated from Makefile. Do not edit!'; \ 41 echo '// This file is generated from Makefile. Do not edit!'; \
42 echo '#include <string>'; \
43 echo ''; \
40 echo '#define DEFAULTMENU "$(DEFAULT_MENU)"'; \ 44 echo '#define DEFAULTMENU "$(DEFAULT_MENU)"'; \
41 echo '#define DEFAULTSTYLE "$(DEFAULT_STYLE)"'; \ 45 echo '#define DEFAULTSTYLE "$(DEFAULT_STYLE)"'; \
42 echo '#define DEFAULTKEYSFILE "$(DEFAULT_KEYSFILE)"'; \ 46 echo '#define DEFAULTKEYSFILE "$(DEFAULT_KEYSFILE)"'; \
43 echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \ 47 echo '#define DEFAULT_INITFILE "$(DEFAULT_INITFILE)"'; \
48 echo '#define PROGRAM_PREFIX "$(PROGRAM_PREFIX:NONE=)"'; \
49 echo '#define PROGRAM_SUFFIX "$(PROGRAM_SUFFIX:NONE=)"'; \
50 echo 'std::string realProgramName(std::string name);'; \
44 echo 'const char* svnversion(void);' ) > defaults.hh 51 echo 'const char* svnversion(void);' ) > defaults.hh
45 52
46defaults.cc: force 53defaults.cc: force
47 @( \ 54 @( \
55 echo '#include "defaults.hh"'; \
56 echo ''; \
57 echo 'std::string realProgramName(std::string name) {'; \
58 echo ' return PROGRAM_PREFIX + name + PROGRAM_SUFFIX;'; \
59 echo '}'; \
60 echo ''; \
48 echo 'const char* svnversion(void) {'; \ 61 echo 'const char* svnversion(void) {'; \
49 echo ' return "'`(svnversion . | sed "s/[^0-9].*//") 2> /dev/null`'";';\ 62 echo ' return "'`(svnversion . | sed "s/[^0-9].*//") 2> /dev/null`'";';\
50 echo '}' ) > defaults_tmp.cc 63 echo '}' ) > defaults_tmp.cc
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index a04860f..16acfb8 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -24,6 +24,7 @@
24 24
25#include "MenuCreator.hh" 25#include "MenuCreator.hh"
26 26
27#include "defaults.hh"
27#include "Screen.hh" 28#include "Screen.hh"
28#include "CommandParser.hh" 29#include "CommandParser.hh"
29#include "fluxbox.hh" 30#include "fluxbox.hh"
@@ -347,7 +348,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
347 else if (str_key == "wallpapers" || str_key == "wallpapermenu" || 348 else if (str_key == "wallpapers" || str_key == "wallpapermenu" ||
348 str_key == "rootcommands") { 349 str_key == "rootcommands") {
349 createRootCmdMenu(menu, str_label, str_label, 350 createRootCmdMenu(menu, str_label, str_label,
350 str_cmd == "" ? "fbsetbg" : str_cmd); 351 str_cmd == "" ? realProgramName("fbsetbg") : str_cmd);
351 } // end of wallpapers 352 } // end of wallpapers
352 else if (str_key == "workspaces") { 353 else if (str_key == "workspaces") {
353 BScreen *screen = Fluxbox::instance()->findScreen(screen_number); 354 BScreen *screen = Fluxbox::instance()->findScreen(screen_number);
diff --git a/src/RootCmdMenuItem.cc b/src/RootCmdMenuItem.cc
index eabc5d3..a52a4d8 100644
--- a/src/RootCmdMenuItem.cc
+++ b/src/RootCmdMenuItem.cc
@@ -23,6 +23,7 @@
23 23
24#include "RootCmdMenuItem.hh" 24#include "RootCmdMenuItem.hh"
25 25
26#include "defaults.hh"
26#include "FbCommands.hh" 27#include "FbCommands.hh"
27#include "fluxbox.hh" 28#include "fluxbox.hh"
28 29
@@ -33,9 +34,10 @@ RootCmdMenuItem::RootCmdMenuItem(const FbTk::FbString &label,
33 const std::string &cmd): 34 const std::string &cmd):
34 FbTk::MenuItem(label), 35 FbTk::MenuItem(label),
35 m_filename(filename) { 36 m_filename(filename) {
36 37
37 FbTk::RefCount<FbTk::Command> 38 std::string prog = cmd.empty() ? realProgramName("fbsetbg") : cmd;
38 setwp_cmd(new FbCommands::ExecuteCmd(cmd + " \"" + m_filename + "\"")); 39 FbTk::RefCount<FbTk::Command>
40 setwp_cmd(new FbCommands::ExecuteCmd(prog + " \"" + m_filename + "\""));
39 setCommand(setwp_cmd); 41 setCommand(setwp_cmd);
40 setToggleItem(true); 42 setToggleItem(true);
41} 43}
diff --git a/src/RootCmdMenuItem.hh b/src/RootCmdMenuItem.hh
index 8c8ac8d..4a541d9 100644
--- a/src/RootCmdMenuItem.hh
+++ b/src/RootCmdMenuItem.hh
@@ -31,7 +31,7 @@ class RootCmdMenuItem: public FbTk::MenuItem {
31public: 31public:
32 RootCmdMenuItem(const FbTk::FbString &label, 32 RootCmdMenuItem(const FbTk::FbString &label,
33 const std::string &filename, 33 const std::string &filename,
34 const std::string &cmd = "fbsetbg"); 34 const std::string &cmd = "");
35 bool isSelected() const; 35 bool isSelected() const;
36private: 36private:
37 const std::string m_filename; 37 const std::string m_filename;
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index 5189fbb..90478e3 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -23,6 +23,7 @@
23 23
24#include "RootTheme.hh" 24#include "RootTheme.hh"
25 25
26#include "defaults.hh"
26#include "FbRootWindow.hh" 27#include "FbRootWindow.hh"
27#include "FbCommands.hh" 28#include "FbCommands.hh"
28#include "Screen.hh" 29#include "Screen.hh"
@@ -212,7 +213,8 @@ void RootTheme::reconfigTheme() {
212 options = "-A "; 213 options = "-A ";
213 214
214 // compose wallpaper application "fbsetbg" with argumetns 215 // compose wallpaper application "fbsetbg" with argumetns
215 std::string commandargs = "fbsetbg " + options + filename; 216 std::string commandargs = realProgramName("fbsetbg") + " " + options +
217 filename;
216 218
217 // call command with options 219 // call command with options
218 FbCommands::ExecuteCmd exec(commandargs, screenNum()); 220 FbCommands::ExecuteCmd exec(commandargs, screenNum());
@@ -220,7 +222,8 @@ void RootTheme::reconfigTheme() {
220 222
221 } else if (FbTk::FileUtil::isDirectory(filename.c_str()) && 223 } else if (FbTk::FileUtil::isDirectory(filename.c_str()) &&
222 strstr(m_background->options().c_str(), "random") != 0) { 224 strstr(m_background->options().c_str(), "random") != 0) {
223 std::string commandargs = "fbsetbg -R " + filename; 225 std::string commandargs = realProgramName("fbsetbg") + " -R " +
226 filename;
224 FbCommands::ExecuteCmd exec(commandargs, screenNum()); 227 FbCommands::ExecuteCmd exec(commandargs, screenNum());
225 exec.execute(); 228 exec.execute();
226 } else { 229 } else {
@@ -251,7 +254,7 @@ void RootTheme::reconfigTheme() {
251 options += "-gradient '" + m_background->options() + "'"; 254 options += "-gradient '" + m_background->options() + "'";
252 } 255 }
253 256
254 std::string commandargs = "fbsetroot " + options; 257 std::string commandargs = realProgramName("fbsetroot") + " " + options;
255 258
256 FbCommands::ExecuteCmd exec(commandargs, screenNum()); 259 FbCommands::ExecuteCmd exec(commandargs, screenNum());
257 exec.execute(); 260 exec.execute();
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 2933ab5..fe30a8f 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -171,6 +171,8 @@ size_t Workspace::numberOfWindows() const {
171 171
172void Workspace::setName(const string &name) { 172void Workspace::setName(const string &name) {
173 if (!name.empty() && name != "") { 173 if (!name.empty() && name != "") {
174 if (name == m_name)
175 return;
174 m_name = name; 176 m_name = name;
175 } else { //if name == 0 then set default name from nls 177 } else { //if name == 0 then set default name from nls
176 _FB_USES_NLS; 178 _FB_USES_NLS;
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 57597a2..bad558b 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -202,11 +202,11 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
202 m_rc_double_click_interval(m_resourcemanager, 250, "session.doubleClickInterval", "Session.DoubleClickInterval"), 202 m_rc_double_click_interval(m_resourcemanager, 250, "session.doubleClickInterval", "Session.DoubleClickInterval"),
203 m_rc_tabs_padding(m_resourcemanager, 0, "session.tabPadding", "Session.TabPadding"), 203 m_rc_tabs_padding(m_resourcemanager, 0, "session.tabPadding", "Session.TabPadding"),
204 m_rc_stylefile(m_resourcemanager, DEFAULTSTYLE, "session.styleFile", "Session.StyleFile"), 204 m_rc_stylefile(m_resourcemanager, DEFAULTSTYLE, "session.styleFile", "Session.StyleFile"),
205 m_rc_styleoverlayfile(m_resourcemanager, "~/.fluxbox/overlay", "session.styleOverlay", "Session.StyleOverlay"), 205 m_rc_styleoverlayfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/overlay", "session.styleOverlay", "Session.StyleOverlay"),
206 m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"), 206 m_rc_menufile(m_resourcemanager, DEFAULTMENU, "session.menuFile", "Session.MenuFile"),
207 m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"), 207 m_rc_keyfile(m_resourcemanager, DEFAULTKEYSFILE, "session.keyFile", "Session.KeyFile"),
208 m_rc_slitlistfile(m_resourcemanager, "~/.fluxbox/slitlist", "session.slitlistFile", "Session.SlitlistFile"), 208 m_rc_slitlistfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/slitlist", "session.slitlistFile", "Session.SlitlistFile"),
209 m_rc_appsfile(m_resourcemanager, "~/.fluxbox/apps", "session.appsFile", "Session.AppsFile"), 209 m_rc_appsfile(m_resourcemanager, "~/." + realProgramName("fluxbox") + "/apps", "session.appsFile", "Session.AppsFile"),
210 m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"), 210 m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"),
211 m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), 211 m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
212 m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), 212 m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"),
@@ -226,7 +226,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
226 m_shutdown(false), 226 m_shutdown(false),
227 m_server_grabs(0), 227 m_server_grabs(0),
228 m_randr_event_type(0), 228 m_randr_event_type(0),
229 m_RC_PATH("fluxbox"), 229 m_RC_PATH(realProgramName("fluxbox")),
230 m_RC_INIT_FILE("init") { 230 m_RC_INIT_FILE("init") {
231 231
232 _FB_USES_NLS; 232 _FB_USES_NLS;
@@ -591,7 +591,7 @@ void Fluxbox::setupConfigFiles() {
591 591
592 bool create_init = false, create_keys = false, create_menu = false; 592 bool create_init = false, create_keys = false, create_menu = false;
593 593
594 string dirname = getenv("HOME") + string("/.") + string(m_RC_PATH) + "/"; 594 string dirname = getenv("HOME") + string("/.") + m_RC_PATH + "/";
595 string init_file, keys_file, menu_file, slitlist_file; 595 string init_file, keys_file, menu_file, slitlist_file;
596 init_file = dirname + m_RC_INIT_FILE; 596 init_file = dirname + m_RC_INIT_FILE;
597 keys_file = dirname + "keys"; 597 keys_file = dirname + "keys";
@@ -648,8 +648,8 @@ void Fluxbox::setupConfigFiles() {
648 if (*config_version < CONFIG_VERSION) { 648 if (*config_version < CONFIG_VERSION) {
649 // configs are out of date, so run fluxbox-update_configs 649 // configs are out of date, so run fluxbox-update_configs
650 650
651 string commandargs = "fluxbox-update_configs -rc "; 651 string commandargs = realProgramName("fluxbox-update_configs");
652 commandargs += init_file; 652 commandargs += " -rc " + init_file;
653 653
654#ifdef HAVE_GETPID 654#ifdef HAVE_GETPID
655 // add the fluxbox pid so fbuc can have us reload rc if necessary 655 // add the fluxbox pid so fbuc can have us reload rc if necessary
@@ -1087,7 +1087,7 @@ void Fluxbox::handleSignal(int signum) {
1087 load_rc(); 1087 load_rc();
1088 break; 1088 break;
1089 case SIGUSR2: 1089 case SIGUSR2:
1090 reload_rc(); 1090 reconfigure();
1091 break; 1091 break;
1092 case SIGSEGV: 1092 case SIGSEGV:
1093 abort(); 1093 abort();
@@ -1546,13 +1546,8 @@ void Fluxbox::load_rc(BScreen &screen) {
1546 } 1546 }
1547} 1547}
1548 1548
1549void Fluxbox::reload_rc() {
1550 load_rc();
1551 reconfigure();
1552}
1553
1554
1555void Fluxbox::reconfigure() { 1549void Fluxbox::reconfigure() {
1550 load_rc();
1556 m_reconfigure_wait = true; 1551 m_reconfigure_wait = true;
1557 m_reconfig_timer.start(); 1552 m_reconfig_timer.start();
1558} 1553}
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index db6270e..2cd8ef3 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -216,7 +216,6 @@ private:
216 216
217 std::string getRcFilename(); 217 std::string getRcFilename();
218 void load_rc(); 218 void load_rc();
219 void reload_rc();
220 219
221 void real_rereadMenu(); 220 void real_rereadMenu();
222 void real_reconfigure(); 221 void real_reconfigure();
@@ -305,7 +304,7 @@ private:
305 int m_randr_event_type; ///< the type number of randr event 304 int m_randr_event_type; ///< the type number of randr event
306 int m_shape_eventbase; ///< event base for shape events 305 int m_shape_eventbase; ///< event base for shape events
307 bool m_have_shape; ///< if shape is supported by server 306 bool m_have_shape; ///< if shape is supported by server
308 const char *m_RC_PATH; 307 std::string m_RC_PATH;
309 const char *m_RC_INIT_FILE; 308 const char *m_RC_INIT_FILE;
310 Atom m_kwm1_dockwindow, m_kwm2_dockwindow; 309 Atom m_kwm1_dockwindow, m_kwm2_dockwindow;
311 310