all repos — fluxbox @ 832dba7d16b77f786b34347cf5dd6c36bd69f586

custom fork of the fluxbox windowmanager

let styles override rootCommand in init, plus removing some code I accidentally left in
markt markt
commit

832dba7d16b77f786b34347cf5dd6c36bd69f586

parent

9de41b30be9af1266860f6e3c76c4e85bfb9abc8

4 files changed, 14 insertions(+), 37 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,9 @@

(Format: Year/Month/Day) Changes for 1.0rc3: *07/01/20: + * Let styles override rootCommand in init file -- for the old behavior, add + `background: none' to the overlay file (Mark) + RootTheme.cc/hh Screen.cc * Don't place windows over toolbar at the top of the screen (Mark) CascadePlacement.cc *07/01/16:
M src/RootTheme.ccsrc/RootTheme.cc

@@ -85,29 +85,11 @@ if (!mod_y.length() || mod_y[0] < '0' || mod_y[0] > '9' ||

(mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9'))) mod_y = "1"; - // check if any of our values have changed - if (mod_x != m_mod_x) { - m_changed = true; - m_mod_x = mod_x; - } - if (mod_y != m_mod_y) { - m_changed = true; - m_mod_y = mod_y; - } - // these aren't quite right, but I don't care - if (color_name != m_color) { - m_changed = true; - m_color = color_name; - } - if (colorto_name != m_color_to) { - m_changed = true; - m_color_to = colorto_name; - } - // remove whitespace from filename FbTk::StringUtil::removeFirstWhitespace(pixmap_name); FbTk::StringUtil::removeTrailingWhitespace(pixmap_name); + // check if the background has been changed if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename || color_name != m_color || colorto_name != m_color_to) { m_changed = true;

@@ -159,12 +141,10 @@ bool m_changed, m_loaded;

}; -RootTheme::RootTheme(const std::string &root_command, - FbTk::ImageControl &image_control): +RootTheme::RootTheme(FbTk::ImageControl &image_control): FbTk::Theme(image_control.screenNumber()), m_background(new BackgroundItem(*this, "background", "Background")), m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())), - m_root_command(root_command), m_image_ctrl(image_control) { Display *disp = FbTk::App::instance()->display();

@@ -207,18 +187,9 @@ return;

m_background->setApplied(); - // if user specified background in the config then use it - // instead of style background - if (!m_root_command.empty()) { - FbCommands::ExecuteCmd cmd(m_root_command, screenNum()); - cmd.execute(); - return; - } - // style doesn't wish to change the background if (strstr(m_background->options().c_str(), "none") != 0) return; - // // Else parse background from style
M src/RootTheme.hhsrc/RootTheme.hh

@@ -45,8 +45,7 @@ public:

/// constructor /// @param resmanager resource manager for finding specific resources /// @param image_control for rendering background texture - RootTheme(const std::string &root_command, - FbTk::ImageControl &image_control); + RootTheme(FbTk::ImageControl &image_control); ~RootTheme(); bool fallback(FbTk::ThemeItem_base &item);

@@ -64,7 +63,6 @@

private: BackgroundItem *m_background;///< background image/texture FbTk::GContext m_opgc; - const std::string &m_root_command; FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture };
M src/Screen.ccsrc/Screen.cc

@@ -62,7 +62,7 @@ #include "Strut.hh"

#include "CommandParser.hh" #include "AtomHandler.hh" #include "HeadArea.hh" - +#include "FbCommands.hh" #include "FbTk/I18n.hh" #include "FbTk/Subject.hh"

@@ -430,7 +430,13 @@ fluxbox->getCacheLife(), fluxbox->getCacheMax()));

imageControl().installRootColormap(); root_colormap_installed = true; - m_root_theme.reset(new RootTheme(*resource.rootcommand, imageControl())); + // if user specified background in the config then use it + if (!resource.rootcommand->empty()) { + FbCommands::ExecuteCmd cmd(*resource.rootcommand, screenNumber()); + cmd.execute(); + } + + m_root_theme.reset(new RootTheme(imageControl())); m_windowtheme->setFocusedAlpha(*resource.focused_alpha); m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha);

@@ -505,7 +511,6 @@ // else we get some bad handle/grip height/width

// 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. FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(), fluxbox->getStyleOverlayFilename(),