aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-18 15:51:30 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-18 15:51:30 (GMT)
commit0ef76292c5447127dc3fd39d6272f6d88a63d145 (patch)
tree167e28347f69bcc8db8dfc38f04a01f70f21df2b /src/fluxbox.hh
parentc9c741c88da3cc5e74f0399c3c5c1f0e70163a7a (diff)
downloadfluxbox-0ef76292c5447127dc3fd39d6272f6d88a63d145.zip
fluxbox-0ef76292c5447127dc3fd39d6272f6d88a63d145.tar.bz2
changed the way we create the '~/.fluxbox' directory to avoid race conditions
before bringing up the first instance of Fluxbox we prepare the directory and the files it needs. if the config version of exiting files is lower than what we expect, we upgrade the config files. after that we bring up Fluxbox. the old way was problematic because setupConfigFiles() calls 'fluxbox-update_configs' which does its job in the background while fluxbox continues to boot. 'fluxbox-update_configs' sends a USR2 signal to the booting fluxbox (it might even be finished, no one knows) which triggers 'load_rc()' which triggered 'setupConfigFiles()' again which might trigger 'fluxbox-update_configs' again (on my machine 'fluxbox-update_configs' was called 3 times and left a pretty crippled 'keys' file when it was done). bootstrapping before bringing up fluxbox resolves the issue. as a bonus: no need to send USR2 to fluxbox to reload the config file because fluxbox has not even tried to read it yet.
Diffstat (limited to 'src/fluxbox.hh')
-rw-r--r--src/fluxbox.hh12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 75b868f..36b39ef 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -79,8 +79,10 @@ class Fluxbox : public FbTk::App,
79 public FbTk::Observer, 79 public FbTk::Observer,
80 private FbTk::SignalTracker { 80 private FbTk::SignalTracker {
81public: 81public:
82 Fluxbox(int argc, char **argv, const char * dpy_name= 0, 82 Fluxbox(int argc, char **argv,
83 const char *rcfilename = 0, bool xsync = false); 83 const std::string& dpy_name,
84 const std::string& rc_path, const std::string& rc_filename,
85 bool xsync = false);
84 virtual ~Fluxbox(); 86 virtual ~Fluxbox();
85 87
86 static Fluxbox *instance() { return s_singleton; } 88 static Fluxbox *instance() { return s_singleton; }
@@ -197,7 +199,6 @@ private:
197 199
198 void handleEvent(XEvent *xe); 200 void handleEvent(XEvent *xe);
199 201
200 void setupConfigFiles();
201 void handleUnmapNotify(XUnmapEvent &ue); 202 void handleUnmapNotify(XUnmapEvent &ue);
202 void handleClientMessage(XClientMessageEvent &ce); 203 void handleClientMessage(XClientMessageEvent &ce);
203 204
@@ -221,6 +222,9 @@ private:
221 222
222 FbTk::ResourceManager m_resourcemanager, &m_screen_rm; 223 FbTk::ResourceManager m_resourcemanager, &m_screen_rm;
223 224
225 std::string m_RC_PATH;
226 const char *m_RC_INIT_FILE;
227
224 //--- Resources 228 //--- Resources
225 229
226 FbTk::Resource<bool> m_rc_ignoreborder; 230 FbTk::Resource<bool> m_rc_ignoreborder;
@@ -289,8 +293,6 @@ private:
289 int m_randr_event_type; ///< the type number of randr event 293 int m_randr_event_type; ///< the type number of randr event
290 int m_shape_eventbase; ///< event base for shape events 294 int m_shape_eventbase; ///< event base for shape events
291 bool m_have_shape; ///< if shape is supported by server 295 bool m_have_shape; ///< if shape is supported by server
292 std::string m_RC_PATH;
293 const char *m_RC_INIT_FILE;
294 Atom m_kwm1_dockwindow, m_kwm2_dockwindow; 296 Atom m_kwm1_dockwindow, m_kwm2_dockwindow;
295 297
296 AttentionNoticeHandler m_attention_handler; 298 AttentionNoticeHandler m_attention_handler;