aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-20 18:26:55 (GMT)
committermarkt <markt>2007-01-20 18:26:55 (GMT)
commit832dba7d16b77f786b34347cf5dd6c36bd69f586 (patch)
tree36db5da8df26bc8d58253a9c852e8146e0434079
parent9de41b30be9af1266860f6e3c76c4e85bfb9abc8 (diff)
downloadfluxbox-832dba7d16b77f786b34347cf5dd6c36bd69f586.zip
fluxbox-832dba7d16b77f786b34347cf5dd6c36bd69f586.tar.bz2
let styles override rootCommand in init, plus removing some code I accidentally left in
-rw-r--r--ChangeLog3
-rw-r--r--src/RootTheme.cc33
-rw-r--r--src/RootTheme.hh4
-rw-r--r--src/Screen.cc11
4 files changed, 14 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index d95da39..278219f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/01/20: 3*07/01/20:
4 * Let styles override rootCommand in init file -- for the old behavior, add
5 `background: none' to the overlay file (Mark)
6 RootTheme.cc/hh Screen.cc
4 * Don't place windows over toolbar at the top of the screen (Mark) 7 * Don't place windows over toolbar at the top of the screen (Mark)
5 CascadePlacement.cc 8 CascadePlacement.cc
6*07/01/16: 9*07/01/16:
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index eeb95f9..98d9067 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -85,29 +85,11 @@ public:
85 (mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9'))) 85 (mod_y.length() == 2 && (mod_y[1] < '0' || mod_y[1] > '9')))
86 mod_y = "1"; 86 mod_y = "1";
87 87
88 // check if any of our values have changed
89 if (mod_x != m_mod_x) {
90 m_changed = true;
91 m_mod_x = mod_x;
92 }
93 if (mod_y != m_mod_y) {
94 m_changed = true;
95 m_mod_y = mod_y;
96 }
97 // these aren't quite right, but I don't care
98 if (color_name != m_color) {
99 m_changed = true;
100 m_color = color_name;
101 }
102 if (colorto_name != m_color_to) {
103 m_changed = true;
104 m_color_to = colorto_name;
105 }
106
107 // remove whitespace from filename 88 // remove whitespace from filename
108 FbTk::StringUtil::removeFirstWhitespace(pixmap_name); 89 FbTk::StringUtil::removeFirstWhitespace(pixmap_name);
109 FbTk::StringUtil::removeTrailingWhitespace(pixmap_name); 90 FbTk::StringUtil::removeTrailingWhitespace(pixmap_name);
110 91
92 // check if the background has been changed
111 if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename || 93 if (mod_x != m_mod_x || mod_y != m_mod_y || pixmap_name != m_filename ||
112 color_name != m_color || colorto_name != m_color_to) { 94 color_name != m_color || colorto_name != m_color_to) {
113 m_changed = true; 95 m_changed = true;
@@ -159,12 +141,10 @@ private:
159}; 141};
160 142
161 143
162RootTheme::RootTheme(const std::string &root_command, 144RootTheme::RootTheme(FbTk::ImageControl &image_control):
163 FbTk::ImageControl &image_control):
164 FbTk::Theme(image_control.screenNumber()), 145 FbTk::Theme(image_control.screenNumber()),
165 m_background(new BackgroundItem(*this, "background", "Background")), 146 m_background(new BackgroundItem(*this, "background", "Background")),
166 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())), 147 m_opgc(RootWindow(FbTk::App::instance()->display(), image_control.screenNumber())),
167 m_root_command(root_command),
168 m_image_ctrl(image_control) { 148 m_image_ctrl(image_control) {
169 149
170 Display *disp = FbTk::App::instance()->display(); 150 Display *disp = FbTk::App::instance()->display();
@@ -207,19 +187,10 @@ void RootTheme::reconfigTheme() {
207 187
208 m_background->setApplied(); 188 m_background->setApplied();
209 189
210 // if user specified background in the config then use it
211 // instead of style background
212 if (!m_root_command.empty()) {
213 FbCommands::ExecuteCmd cmd(m_root_command, screenNum());
214 cmd.execute();
215 return;
216 }
217
218 // style doesn't wish to change the background 190 // style doesn't wish to change the background
219 if (strstr(m_background->options().c_str(), "none") != 0) 191 if (strstr(m_background->options().c_str(), "none") != 0)
220 return; 192 return;
221 193
222
223 // 194 //
224 // Else parse background from style 195 // Else parse background from style
225 // 196 //
diff --git a/src/RootTheme.hh b/src/RootTheme.hh
index aee6d85..abfea7c 100644
--- a/src/RootTheme.hh
+++ b/src/RootTheme.hh
@@ -45,8 +45,7 @@ public:
45 /// constructor 45 /// constructor
46 /// @param resmanager resource manager for finding specific resources 46 /// @param resmanager resource manager for finding specific resources
47 /// @param image_control for rendering background texture 47 /// @param image_control for rendering background texture
48 RootTheme(const std::string &root_command, 48 RootTheme(FbTk::ImageControl &image_control);
49 FbTk::ImageControl &image_control);
50 ~RootTheme(); 49 ~RootTheme();
51 50
52 bool fallback(FbTk::ThemeItem_base &item); 51 bool fallback(FbTk::ThemeItem_base &item);
@@ -64,7 +63,6 @@ public:
64private: 63private:
65 BackgroundItem *m_background;///< background image/texture 64 BackgroundItem *m_background;///< background image/texture
66 FbTk::GContext m_opgc; 65 FbTk::GContext m_opgc;
67 const std::string &m_root_command;
68 FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture 66 FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture
69 67
70}; 68};
diff --git a/src/Screen.cc b/src/Screen.cc
index 2bb243f..a50d1ba 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -62,7 +62,7 @@
62#include "CommandParser.hh" 62#include "CommandParser.hh"
63#include "AtomHandler.hh" 63#include "AtomHandler.hh"
64#include "HeadArea.hh" 64#include "HeadArea.hh"
65 65#include "FbCommands.hh"
66 66
67#include "FbTk/I18n.hh" 67#include "FbTk/I18n.hh"
68#include "FbTk/Subject.hh" 68#include "FbTk/Subject.hh"
@@ -430,7 +430,13 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
430 imageControl().installRootColormap(); 430 imageControl().installRootColormap();
431 root_colormap_installed = true; 431 root_colormap_installed = true;
432 432
433 m_root_theme.reset(new RootTheme(*resource.rootcommand, imageControl())); 433 // if user specified background in the config then use it
434 if (!resource.rootcommand->empty()) {
435 FbCommands::ExecuteCmd cmd(*resource.rootcommand, screenNumber());
436 cmd.execute();
437 }
438
439 m_root_theme.reset(new RootTheme(imageControl()));
434 440
435 m_windowtheme->setFocusedAlpha(*resource.focused_alpha); 441 m_windowtheme->setFocusedAlpha(*resource.focused_alpha);
436 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha); 442 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha);
@@ -505,7 +511,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
505 // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get()); 511 // FbTk::ThemeManager::instance().loadTheme(*m_windowtheme.get());
506 //!! TODO: For some strange reason we must load everything, 512 //!! TODO: For some strange reason we must load everything,
507 // else the focus label doesn't get updated 513 // else the focus label doesn't get updated
508 // So we lock root theme temporary so it doesn't uses RootTheme::reconfigTheme
509 // This must be fixed in the future. 514 // This must be fixed in the future.
510 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(), 515 FbTk::ThemeManager::instance().load(fluxbox->getStyleFilename(),
511 fluxbox->getStyleOverlayFilename(), 516 fluxbox->getStyleOverlayFilename(),