summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-02 13:29:01 (GMT)
committerfluxgen <fluxgen>2004-01-02 13:29:01 (GMT)
commit345ef845c94bb4d77ed210e2c7a2c252d3068d59 (patch)
tree48df8829a4a14fc744b901b1b3c30990bd6c4862
parente9b5ad4e401e8742b0871889476ddc4eeae60b08 (diff)
downloadfluxbox_lack-345ef845c94bb4d77ed210e2c7a2c252d3068d59.zip
fluxbox_lack-345ef845c94bb4d77ed210e2c7a2c252d3068d59.tar.bz2
lock roottheme so it doesn't get run twice
-rw-r--r--src/RootTheme.cc12
-rw-r--r--src/RootTheme.hh6
-rw-r--r--src/Screen.cc11
3 files changed, 21 insertions, 8 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index 15723ac..03eb8b1 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -19,19 +19,20 @@
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: RootTheme.cc,v 1.6 2003/09/12 23:33:13 fluxgen Exp $ 22// $Id: RootTheme.cc,v 1.7 2004/01/02 13:28:38 fluxgen Exp $
23 23
24#include "RootTheme.hh" 24#include "RootTheme.hh"
25 25
26#include "FbCommands.hh" 26#include "FbCommands.hh"
27#include "App.hh" 27#include "FbTk/App.hh"
28 28
29RootTheme::RootTheme(int screen_num, std::string &screen_root_command): 29RootTheme::RootTheme(int screen_num, std::string &screen_root_command):
30 FbTk::Theme(screen_num), 30 FbTk::Theme(screen_num),
31 m_root_command(*this, "rootCommand", "RootCommand"), 31 m_root_command(*this, "rootCommand", "RootCommand"),
32 m_screen_root_command(screen_root_command), 32 m_screen_root_command(screen_root_command),
33 m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)) { 33 m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)),
34 34 m_lock(false) {
35
35 Display *disp = FbTk::App::instance()->display(); 36 Display *disp = FbTk::App::instance()->display();
36 m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num)); 37 m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num));
37 m_opgc.setFunction(GXxor); 38 m_opgc.setFunction(GXxor);
@@ -43,6 +44,9 @@ RootTheme::~RootTheme() {
43} 44}
44 45
45void RootTheme::reconfigTheme() { 46void RootTheme::reconfigTheme() {
47 if (m_lock)
48 return;
49
46 // override resource root command? 50 // override resource root command?
47 if (m_screen_root_command == "") { 51 if (m_screen_root_command == "") {
48 // do root command 52 // do root command
diff --git a/src/RootTheme.hh b/src/RootTheme.hh
index 3f12358..686a4ed 100644
--- a/src/RootTheme.hh
+++ b/src/RootTheme.hh
@@ -19,7 +19,7 @@
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: RootTheme.hh,v 1.5 2003/09/12 23:33:13 fluxgen Exp $ 22// $Id: RootTheme.hh,v 1.6 2004/01/02 13:28:38 fluxgen Exp $
23 23
24#ifndef ROOTTHEME_HH 24#ifndef ROOTTHEME_HH
25#define ROOTTHEME_HH 25#define ROOTTHEME_HH
@@ -44,11 +44,13 @@ public:
44 void reconfigTheme(); 44 void reconfigTheme();
45 45
46 GC opGC() const { return m_opgc.gc(); } 46 GC opGC() const { return m_opgc.gc(); }
47 47 //!! TODO we should need this later
48 void lock(bool value) { m_lock = value; }
48private: 49private:
49 FbTk::ThemeItem<std::string> m_root_command; 50 FbTk::ThemeItem<std::string> m_root_command;
50 std::string &m_screen_root_command; ///< string to execute and override theme rootCommand 51 std::string &m_screen_root_command; ///< string to execute and override theme rootCommand
51 FbTk::GContext m_opgc; 52 FbTk::GContext m_opgc;
53 bool m_lock;
52}; 54};
53 55
54#endif // ROOTTHEME_HH 56#endif // ROOTTHEME_HH
diff --git a/src/Screen.cc b/src/Screen.cc
index fb4ee34..1e5d94d 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.256 2003/12/31 00:38:40 fluxgen Exp $ 25// $Id: Screen.cc,v 1.257 2004/01/02 13:29:01 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -558,7 +558,14 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
558 // we need to load win frame theme before we create any fluxbox window 558 // we need to load win frame theme before we create any fluxbox window
559 // and after we've load the resources 559 // and after we've load the resources
560 // else we get some bad handle/grip height/width 560 // else we get some bad handle/grip height/width
561 FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get()); 561 // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get());
562 //!! TODO: For some strange reason we must load everything,
563 // else the focus label doesn't get updated
564 // So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme
565 // This must be fixed in the future.
566 m_root_theme->lock(true);
567 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename());
568 m_root_theme->lock(false);
562 569
563 int i; 570 int i;
564 unsigned int nchild; 571 unsigned int nchild;