all repos — fluxbox @ 345ef845c94bb4d77ed210e2c7a2c252d3068d59

custom fork of the fluxbox windowmanager

lock roottheme so it doesn't get run twice
fluxgen fluxgen
commit

345ef845c94bb4d77ed210e2c7a2c252d3068d59

parent

e9b5ad4e401e8742b0871889476ddc4eeae60b08

3 files changed, 21 insertions(+), 8 deletions(-)

jump to
M src/RootTheme.ccsrc/RootTheme.cc

@@ -19,19 +19,20 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RootTheme.cc,v 1.6 2003/09/12 23:33:13 fluxgen Exp $ +// $Id: RootTheme.cc,v 1.7 2004/01/02 13:28:38 fluxgen Exp $ #include "RootTheme.hh" #include "FbCommands.hh" -#include "App.hh" +#include "FbTk/App.hh" RootTheme::RootTheme(int screen_num, std::string &screen_root_command): FbTk::Theme(screen_num), m_root_command(*this, "rootCommand", "RootCommand"), m_screen_root_command(screen_root_command), - m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)) { - + m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)), + m_lock(false) { + Display *disp = FbTk::App::instance()->display(); m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num)); m_opgc.setFunction(GXxor);

@@ -43,6 +44,9 @@

} void RootTheme::reconfigTheme() { + if (m_lock) + return; + // override resource root command? if (m_screen_root_command == "") { // do root command
M src/RootTheme.hhsrc/RootTheme.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RootTheme.hh,v 1.5 2003/09/12 23:33:13 fluxgen Exp $ +// $Id: RootTheme.hh,v 1.6 2004/01/02 13:28:38 fluxgen Exp $ #ifndef ROOTTHEME_HH #define ROOTTHEME_HH

@@ -44,11 +44,13 @@

void reconfigTheme(); GC opGC() const { return m_opgc.gc(); } - + //!! TODO we should need this later + void lock(bool value) { m_lock = value; } private: FbTk::ThemeItem<std::string> m_root_command; std::string &m_screen_root_command; ///< string to execute and override theme rootCommand FbTk::GContext m_opgc; + bool m_lock; }; #endif // ROOTTHEME_HH
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.256 2003/12/31 00:38:40 fluxgen Exp $ +// $Id: Screen.cc,v 1.257 2004/01/02 13:29:01 fluxgen Exp $ #include "Screen.hh"

@@ -558,7 +558,14 @@

// we need to load win frame theme before we create any fluxbox window // and after we've load the resources // else we get some bad handle/grip height/width - FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get()); + // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get()); + //!! TODO: For some strange reason we must load everything, + // else the focus label doesn't get updated + // So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme + // This must be fixed in the future. + m_root_theme->lock(true); + FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); + m_root_theme->lock(false); int i; unsigned int nchild;