summaryrefslogtreecommitdiffstats
path: root/kdm/kfrontend/themer/kdmthemer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-13 02:31:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-13 02:31:25 +0000
commitf50ce50331053efe6b06b3917bf07a5a64398736 (patch)
tree3b6de07bf3f62b177816725b61650cf4589a9db0 /kdm/kfrontend/themer/kdmthemer.cpp
parentecb591aa8446dd7b133e1674287924a5e2c0ac14 (diff)
downloadtdebase-f50ce50331053efe6b06b3917bf07a5a64398736.tar.gz
tdebase-f50ce50331053efe6b06b3917bf07a5a64398736.zip
Add Xorg composition support to kdm
KDM composition can be enabled in the control center When enabled, it provides seamless composited logins to Trinity sessions It also gets rid of the remaining artifacts in the themed kdm login screen git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1246834 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
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: