aboutsummaryrefslogtreecommitdiff
path: root/src/Slit.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-12 14:56:20 (GMT)
committerrathnor <rathnor>2004-09-12 14:56:20 (GMT)
commit42c1fd3ae3dd058e146b7350c65b74386123c25c (patch)
treecc549c2c7b12c87f8c33198f5b30f00d9dd30bc6 /src/Slit.cc
parentc39234195a46cece2bdb18dfdde6c91c7a190dc4 (diff)
downloadfluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.zip
fluxbox_pavel-42c1fd3ae3dd058e146b7350c65b74386123c25c.tar.bz2
preliminary support for composite/compositing manager. Also general work
for consistency with transparency resources
Diffstat (limited to 'src/Slit.cc')
-rw-r--r--src/Slit.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index 0023965..4413c48 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Slit.cc,v 1.101 2004/09/11 18:58:27 fluxgen Exp $ 25// $Id: Slit.cc,v 1.102 2004/09/12 14:56:19 rathnor Exp $
26 26
27#include "Slit.hh" 27#include "Slit.hh"
28 28
@@ -296,7 +296,12 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
296 296
297 FbTk::EventManager::instance()->add(*this, frame.window); 297 FbTk::EventManager::instance()->add(*this, frame.window);
298 298
299 frame.window.setAlpha(*m_rc_alpha); 299 if (FbTk::Transparent::haveComposite()) {
300 frame.window.setOpaque(*m_rc_alpha);
301 } else {
302 frame.window.setAlpha(*m_rc_alpha);
303 }
304
300 m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer)); 305 m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer));
301 m_layermenu.reset(new LayerMenu<Slit>(scr.menuTheme(), 306 m_layermenu.reset(new LayerMenu<Slit>(scr.menuTheme(),
302 scr.imageControl(), 307 scr.imageControl(),
@@ -679,7 +684,11 @@ void Slit::reconfigure() {
679 if (tmp) 684 if (tmp)
680 image_ctrl.removeImage(tmp); 685 image_ctrl.removeImage(tmp);
681 686
682 frame.window.setAlpha(*m_rc_alpha); 687 if (FbTk::Transparent::haveComposite()) {
688 frame.window.setOpaque(*m_rc_alpha);
689 } else {
690 frame.window.setAlpha(*m_rc_alpha);
691 }
683 clearWindow(); 692 clearWindow();
684 693
685 int x = 0, y = 0; 694 int x = 0, y = 0;
@@ -1195,9 +1204,9 @@ void Slit::setupMenu() {
1195 0, 255); 1204 0, 255);
1196 // setup command for alpha value 1205 // setup command for alpha value
1197 MacroCommand *alpha_macrocmd = new MacroCommand(); 1206 MacroCommand *alpha_macrocmd = new MacroCommand();
1198 RefCount<Command> clear_cmd(new SimpleCommand<Slit>(*this, &Slit::clearWindow)); 1207 RefCount<Command> alpha_cmd(new SimpleCommand<Slit>(*this, &Slit::updateAlpha));
1199 alpha_macrocmd->add(saverc_cmd); 1208 alpha_macrocmd->add(saverc_cmd);
1200 alpha_macrocmd->add(clear_cmd); 1209 alpha_macrocmd->add(alpha_cmd);
1201 RefCount<Command> set_alpha_cmd(alpha_macrocmd); 1210 RefCount<Command> set_alpha_cmd(alpha_macrocmd);
1202 alpha_menuitem->setCommand(set_alpha_cmd); 1211 alpha_menuitem->setCommand(set_alpha_cmd);
1203 1212
@@ -1263,3 +1272,12 @@ void Slit::saveOnHead(int head) {
1263 reconfigure(); 1272 reconfigure();
1264} 1273}
1265 1274
1275void Slit::updateAlpha() {
1276 // called when the alpha resource is changed
1277 if (FbTk::Transparent::haveComposite()) {
1278 frame.window.setOpaque(*m_rc_alpha);
1279 } else {
1280 frame.window.setAlpha(*m_rc_alpha);
1281 clearWindow();
1282 }
1283}