From edffe9c93f051e863f9fb9c768a837534c2e567f Mon Sep 17 00:00:00 2001 From: Jim Ramsay Date: Fri, 24 Apr 2009 11:25:08 -0400 Subject: Allow 'background: unset' When a user sets 'background: none' it really means "Do not let themes touch the background I have already set with fbsetbg" -> It does still actually call fbsetbeg to re-assert the proper background. This new value 'unset' is for users who will use an alternate method to set their background (root-tail, xscreensaver, or whatever). It instructs fluxbox to *never* run fbsetbg. --- doc/asciidoc/fluxbox-style.txt | 7 +++++-- doc/fluxbox-style.5.in | 8 ++++---- src/RootTheme.cc | 4 ++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/asciidoc/fluxbox-style.txt b/doc/asciidoc/fluxbox-style.txt index 02838fb..69a1d6d 100644 --- a/doc/asciidoc/fluxbox-style.txt +++ b/doc/asciidoc/fluxbox-style.txt @@ -361,9 +361,12 @@ resource to contain a valid file name. The `random' option requires `solid', and `mod' all require `background.color' to be set. `gradient' and `mod' both require `background.colorTo'. `mod' requires `background.modX' and `background.modY' to be set as well. These options will be passed to -*fbsetroot(1)* to set the background. +*fbsetroot(1)* to set the background. The special option `unset' is for use in +user overlay files only. It specifies that fbsetbg should never be run (by +default, even when `none' is set in the overlay, fluxbox will try to run +``fbsetbg -z'' to restore the last wallpaper). - background: centered|aspect|tiled|fullscreen|random|solid|gradient |mod|none + background: centered|aspect|tiled|fullscreen|random|solid|gradient |mod|none|unset background.pixmap: background.color: background.colorTo: diff --git a/doc/fluxbox-style.5.in b/doc/fluxbox-style.5.in index 62a82e6..25f9a16 100644 --- a/doc/fluxbox-style.5.in +++ b/doc/fluxbox-style.5.in @@ -1,12 +1,12 @@ .\" Title: fluxbox-style .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.74.0 -.\" Date: 02/19/2009 +.\" Date: 05/26/2009 .\" Manual: Fluxbox Manual .\" Source: fluxbox-style.txt 1.1.2 .\" Language: English .\" -.TH "FLUXBOX\-STYLE" "5" "02/19/2009" "fluxbox\-style\&.txt 1\&.1\&.2" "Fluxbox Manual" +.TH "FLUXBOX\-STYLE" "5" "05/26/2009" "fluxbox\-style\&.txt 1\&.1\&.2" "Fluxbox Manual" .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" ----------------------------------------------------------------- @@ -611,7 +611,7 @@ menu\&.unselected\&.pixmap: .\} .SH "BACKGROUND" .sp -Every style must specify the background option\&. If you don\'t want your style to change the user\'s background, then use `background: none\'\&. The options `centered\', `aspect\', `tiled\', and `fullscreen\' require the `background\&.pixmap\' resource to contain a valid file name\&. The `random\' option requires `background\&.pixmap\' to contain a valid directory name\&. For these options, \fBfluxbox(1)\fR will call \fBfbsetbg(1)\fR to set the background\&. The options `gradient\', `solid\', and `mod\' all require `background\&.color\' to be set\&. `gradient\' and `mod\' both require `background\&.colorTo\'\&. `mod\' requires `background\&.modX\' and `background\&.modY\' to be set as well\&. These options will be passed to \fBfbsetroot(1)\fR to set the background\&. +Every style must specify the background option\&. If you don\'t want your style to change the user\'s background, then use `background: none\'\&. The options `centered\', `aspect\', `tiled\', and `fullscreen\' require the `background\&.pixmap\' resource to contain a valid file name\&. The `random\' option requires `background\&.pixmap\' to contain a valid directory name\&. For these options, \fBfluxbox(1)\fR will call \fBfbsetbg(1)\fR to set the background\&. The options `gradient\', `solid\', and `mod\' all require `background\&.color\' to be set\&. `gradient\' and `mod\' both require `background\&.colorTo\'\&. `mod\' requires `background\&.modX\' and `background\&.modY\' to be set as well\&. These options will be passed to \fBfbsetroot(1)\fR to set the background\&. The special option `unset\' is for use in user overlay files only\&. It specifies that fbsetbg should never be run (by default, even when `none\' is set in the overlay, fluxbox will try to run \(lqfbsetbg \-z\(rq to restore the last wallpaper)\&. .sp .if n \{\ .RS 4 @@ -620,7 +620,7 @@ Every style must specify the background option\&. If you don\'t want your style .ps -1 .nf .BB lightgray -background: centered|aspect|tiled|fullscreen|random|solid|gradient |mod|none +background: centered|aspect|tiled|fullscreen|random|solid|gradient |mod|none|unset background\&.pixmap: background\&.color: background\&.colorTo: diff --git a/src/RootTheme.cc b/src/RootTheme.cc index 049eb27..34c06e9 100644 --- a/src/RootTheme.cc +++ b/src/RootTheme.cc @@ -202,6 +202,10 @@ void RootTheme::reconfigTheme() { filename = FbTk::StringUtil::expandFilename(filename); std::string cmd = realProgramName("fbsetbg") + (m_first ? " -z " : " -Z "); + // user explicitly requests NO background be set at all + if (strstr(m_background->options().c_str(), "unset") != 0) { + return; + } // style doesn't wish to change the background if (strstr(m_background->options().c_str(), "none") != 0) { if (!m_first) -- cgit v0.11.2