aboutsummaryrefslogtreecommitdiff
path: root/src/RootTheme.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-10-07 01:16:26 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-10-07 01:16:26 (GMT)
commitdda95bf106079fdfd12a690de0ce79a88279505f (patch)
treebdf8d56789f56c094e775a32fd3b26e9b36fa64b /src/RootTheme.cc
parentc033c201c4254c11804713dc427d22940da05438 (diff)
downloadfluxbox-dda95bf106079fdfd12a690de0ce79a88279505f.zip
fluxbox-dda95bf106079fdfd12a690de0ce79a88279505f.tar.bz2
allow relative path for background images in style files
Diffstat (limited to 'src/RootTheme.cc')
-rw-r--r--src/RootTheme.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index a40732e..049eb27 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -28,6 +28,7 @@
28 28
29#include "FbTk/App.hh" 29#include "FbTk/App.hh"
30#include "FbTk/Font.hh" 30#include "FbTk/Font.hh"
31#include "FbTk/Image.hh"
31#include "FbTk/ImageControl.hh" 32#include "FbTk/ImageControl.hh"
32#include "FbTk/Resource.hh" 33#include "FbTk/Resource.hh"
33#include "FbTk/FileUtil.hh" 34#include "FbTk/FileUtil.hh"
@@ -197,6 +198,7 @@ void RootTheme::reconfigTheme() {
197 // if background argument is a file then 198 // if background argument is a file then
198 // parse image options and call image setting 199 // parse image options and call image setting
199 // command specified in the resources 200 // command specified in the resources
201 std::string img_path = FbTk::Image::locateFile(filename);
200 filename = FbTk::StringUtil::expandFilename(filename); 202 filename = FbTk::StringUtil::expandFilename(filename);
201 std::string cmd = realProgramName("fbsetbg") + (m_first ? " -z " : " -Z "); 203 std::string cmd = realProgramName("fbsetbg") + (m_first ? " -z " : " -Z ");
202 204
@@ -204,7 +206,7 @@ void RootTheme::reconfigTheme() {
204 if (strstr(m_background->options().c_str(), "none") != 0) { 206 if (strstr(m_background->options().c_str(), "none") != 0) {
205 if (!m_first) 207 if (!m_first)
206 return; 208 return;
207 } else if (FbTk::FileUtil::isRegularFile(filename.c_str())) { 209 } else if (!img_path.empty()) {
208 // parse options 210 // parse options
209 if (strstr(m_background->options().c_str(), "tiled") != 0) 211 if (strstr(m_background->options().c_str(), "tiled") != 0)
210 cmd += "-t "; 212 cmd += "-t ";
@@ -215,7 +217,7 @@ void RootTheme::reconfigTheme() {
215 else 217 else
216 cmd += "-f "; 218 cmd += "-f ";
217 219
218 cmd += filename; 220 cmd += img_path;
219 } else if (FbTk::FileUtil::isDirectory(filename.c_str()) && 221 } else if (FbTk::FileUtil::isDirectory(filename.c_str()) &&
220 strstr(m_background->options().c_str(), "random") != 0) { 222 strstr(m_background->options().c_str(), "random") != 0) {
221 cmd += "-r " + filename; 223 cmd += "-r " + filename;