summaryrefslogtreecommitdiffstats
path: root/kdm/kfrontend/themer/kdmthemer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdm/kfrontend/themer/kdmthemer.cpp')
-rw-r--r--kdm/kfrontend/themer/kdmthemer.cpp40
1 files changed, 30 insertions, 10 deletions
diff --git a/kdm/kfrontend/themer/kdmthemer.cpp b/kdm/kfrontend/themer/kdmthemer.cpp
index d6b2e6e0e..39a1abe81 100644
--- a/kdm/kfrontend/themer/kdmthemer.cpp
+++ b/kdm/kfrontend/themer/kdmthemer.cpp
@@ -46,6 +46,8 @@
#include <unistd.h>
+extern bool argb_visual_available;
+
/*
* KdmThemer. The main theming interface
*/
@@ -159,17 +161,35 @@ KdmThemer::widgetEvent( TQEvent *e )
TQRect paintRect = TQT_TQPAINTEVENT(e)->rect();
kdDebug() << timestamp() << " paint on: " << paintRect << endl;
- if (!backBuffer)
- backBuffer = new TQPixmap( widget()->size() );
- if (backBuffer->size() != widget()->size())
- backBuffer->resize( widget()->size() );
-
- TQPainter p;
- p.begin( backBuffer );
- rootItem->paint( &p, paintRect );
- p.end();
+ if ((_compositor.isEmpty()) || (!argb_visual_available)) {
+ // Software blend only (no compositing support)
+ if (!backBuffer)
+ backBuffer = new TQPixmap( widget()->size() );
+ if (backBuffer->size() != widget()->size())
+ backBuffer->resize( widget()->size() );
+
+ TQPainter p;
+ p.begin( backBuffer );
+ rootItem->paint( &p, paintRect );
+ p.end();
+
+ bitBlt( widget(), paintRect.topLeft(), backBuffer, paintRect );
+ }
+ else {
+ // We have compositing support!
+ TQRgb blend_color = tqRgba(0, 0, 0, 0); // RGBA
+ float alpha = tqAlpha(blend_color) / 255.;
+ int pixel = tqAlpha(blend_color) << 24 |
+ int(tqRed(blend_color) * alpha) << 16 |
+ int(tqGreen(blend_color) * alpha) << 8 |
+ int(tqBlue(blend_color) * alpha);
+ TQPainter p1;
+ p1.begin( widget() );
+ p1.fillRect( paintRect, TQColor(blend_color, pixel) );
+ rootItem->paint( &p1, paintRect );
+ p1.end();
+ }
- bitBlt( widget(), paintRect.topLeft(), backBuffer, paintRect );
}
break;
default: