Index: src/karamba.cpp
===================================================================
--- src/karamba.cpp	(revision 551150)
+++ src/karamba.cpp	(working copy)
@@ -261,8 +261,10 @@
   }
   else
   {
+#ifdef USE_KROOT
     kroot = new KarambaRootPixmap((QWidget*)this);
     kroot->start();
+#endif /* KROOT_REMOVE */
   }
 
   // Karamba specific Config Entries
@@ -307,6 +309,7 @@
   haveUpdated = 0;
   this->setMouseTracking(true);
 
+  this->setAutoMask(true);
 
   setFocusPolicy(QWidget::StrongFocus);
 }
@@ -1494,6 +1497,12 @@
   //  delete this;
 }
 
+void karamba::updateMask()  // paint clock mask
+{
+//    printf ("updateMask : mask @ %p\n", &mask);
+    setMask( mask );
+}
+
 void karamba::paintEvent ( QPaintEvent *e)
 {
   //kdDebug() << k_funcinfo << pm.size() << endl;
@@ -1581,7 +1590,9 @@
 void karamba::currentDesktopChanged( int i )
 {
   //qDebug("karamba::currentDesktopChanged");
+#ifdef USE_KROOT
   kroot->repaint( true );
+#endif
   if (pythonIface && pythonIface->isExtensionLoaded())
     pythonIface->desktopChanged(this, i);
 }
@@ -1589,7 +1600,9 @@
 void karamba::currentWallpaperChanged(int i )
 {
   //qDebug("karamba::currentWallpaperChanged");
+#ifdef USE_KROOT
   kroot->repaint( true );
+#endif
   if (pythonIface && pythonIface->isExtensionLoaded())
     pythonIface->wallpaperChanged(this, i);
 }
@@ -1615,7 +1628,36 @@
     }
     p.end();
 
+#ifndef USE_KROOT
+    mask = QBitmap(size());
+    
+    mask.fill(Qt::color0);
+    MeterPainter paint;
+    
+    paint.begin( &mask, this );
+    paint.setMaskLock(false);
+    paint.setBrush( color1 );           // use non-transparent color
+    paint.setPen( color1 );
+    paint.setMaskLock(true);
+    
+    QObjectListIt maskit( *meterList ); // iterate over meters
+    while ( maskit != 0 )
+    {
+        TextLabel *meter = (TextLabel *) *maskit;
+        QColor col, bgcol;
+        
+        meter->mUpdate(&paint);
+        
+        ++maskit;
+    }
+    paint.end();
+#endif
+
     bitBlt(&pm,0,0,&buffer,0,Qt::CopyROP);
+
+    if (autoMask())
+        updateMask();
+
     repaint();
   }
 }
@@ -1641,7 +1683,46 @@
     }
     p.end();
 
+#ifndef USE_KROOT
+    mask = QBitmap(size());
+
+    mask.fill(Qt::color0);
+    MeterPainter paint;
+    
+    paint.begin( &mask, this );
+    paint.setMaskLock(false);
+    paint.setBrush( color1 );           // use non-transparent color
+    paint.setPen( color1 );
+    paint.setMaskLock(true);
+
+    QObjectListIt maskit( *meterList ); // iterate over meters
+    while ( maskit != 0 )
+    {
+        TextLabel *meter = (TextLabel *) *maskit;
+        QColor col, bgcol;
+        
+//        col = meter->getColor();
+//        bgcol = meter->getBGColor();
+
+//        meter->setColor(Qt::color1);
+//        meter->setBGColor(Qt::color1);
+        meter->mUpdate(&paint);
+
+//        meter->setColor(col);
+//        meter->setBGColor(bgcol);
+
+        ++maskit;
+    }
+    paint.end();
+#endif //USE_KROOT
+
     bitBlt(&pm,0,0,&buffer,0,Qt::CopyROP);
+
+#ifndef USE_KROOT
+    if (autoMask())
+        updateMask();
+#endif //USE_KROOT
+
     update();
   }
 
Index: src/input.cpp
===================================================================
--- src/input.cpp	(revision 551150)
+++ src/input.cpp	(working copy)
@@ -33,7 +33,8 @@
   delete edit;
 }
 
-void Input::mUpdate(QPainter*)
+//void Input::mUpdate(QPainter*)
+void Input::mUpdate(MeterPainter *)
 {
   edit->repaint();
 }
Index: src/richtextlabel.h
===================================================================
--- src/richtextlabel.h	(revision 551150)
+++ src/richtextlabel.h	(working copy)
@@ -48,7 +48,8 @@
     virtual bool insideActiveArea(int, int);
 
     virtual bool click(QMouseEvent*);
-    virtual void mUpdate(QPainter*);
+    //virtual void mUpdate(QPainter*);
+    virtual void mUpdate( MeterPainter * );
 
     QString anchorAt(int, int);
 
Index: src/graph.cpp
===================================================================
--- src/graph.cpp	(revision 551150)
+++ src/graph.cpp	(working copy)
@@ -51,7 +51,8 @@
   setValue((int)(v.toDouble() + 0.5));
 }
 
-void Graph::mUpdate(QPainter *p)
+//void Graph::mUpdate(QPainter *p)
+void Graph::mUpdate(MeterPainter *p)
 {
   if (hidden == 0)
   {
Index: src/meter.cpp
===================================================================
--- src/meter.cpp	(revision 551150)
+++ src/meter.cpp	(working copy)
@@ -9,6 +9,7 @@
  ***************************************************************************/
 #include "meter.h"
 
+
 Meter::Meter(karamba* k, int ix, int iy, int iw, int ih):
   boundingBox(ix, iy, iw, ih), leftButtonAction(""), middleButtonAction(""),
   rightButtonAction(""), clickable(true), hidden(0), minValue(0), maxValue(0),
@@ -23,6 +24,126 @@
 {
 }
 
+MeterPainter::MeterPainter()
+    : QPainter()
+{
+    masklock = false;
+}
+void MeterPainter::setPen(const QPen &pen)
+{
+    QColor pcol = pen.color();
+/*
+    printf ("called setpen: %d,%d,%d lock %d\n",
+            pcol.red(),
+            pcol.green(),
+            pcol.blue(),
+            (masklock==true)?1:0);
+*/
+    if (!maskLock())
+        QPainter::setPen(pen);
+}
+
+bool MeterPainter::maskLock()
+{
+    return masklock;
+}
+
+void MeterPainter::setMaskLock( bool lock)
+{
+    masklock = lock;
+}
+
+int pixel_alpha(const QImage &image, int x, int y)
+{
+    QRgb pixel = image.pixel(x,y);
+    return qAlpha(pixel);
+}
+
+QBitmap convertToMask(const QPixmap &pixmap)
+{
+    QImage image = pixmap.convertToImage();
+    QImage newim = QImage(image.size(), 8, 2);
+
+    newim.setColor(0, qRgb(0,0,0));
+    newim.setColor(1, qRgb(255,255,255));
+
+//    printf ("Size: %d,%d\n", newim.width(), newim.height());
+    
+    for (int i=0; i<image.width(); i++)
+    {
+        for (int j=0; j<image.height(); j++)
+        {
+            // DEBUG
+//            printf ("%d, %d: %d\n", i, j, pixel_alpha(image, i, j));
+            if (pixel_alpha(image, i, j) == 0)
+                *(newim.scanLine(j) + i) = 1;
+            else
+                *(newim.scanLine(j) + i) = 0;
+        }
+    }
+
+    QBitmap bmap;
+    bmap = newim;
+    return bmap;
+}
+void MeterPainter::drawPixmap ( int x,
+                                int y,
+                                const QPixmap & pixmap,
+                                int sx,
+                                int sy,
+                                     int sw,
+                                     int sh )
+{
+    if (masklock)
+    {
+        QBitmap bmap;
+        bmap = convertToMask(pixmap);
+
+        QPainter::drawPixmap(x,y,bmap,sx,sy,sw,sh);
+    }
+    else
+        QPainter::drawPixmap(x,y,pixmap,sx,sy,sw,sh);
+}
+
+void MeterPainter::drawTiledPixmap ( int x,
+                                     int y,
+                                     int w,
+                                     int h,
+                                     const QPixmap & pixmap,
+                                     int sx,
+                                     int sy ) 
+{
+    if (masklock)
+    {
+        QBitmap bmap;
+        bmap = convertToMask(pixmap);
+
+        QPainter::drawTiledPixmap(x,y,w,h,bmap,sx,sy);
+    }
+    else
+        QPainter::drawTiledPixmap(x,y,w,h,pixmap,sx,sy);
+
+}
+
+void MeterPainter::drawImage ( int x,
+                 int y,
+                 const QImage & image,
+                 int sx,
+                 int sy,
+                 int sw,
+                 int sh,
+                 int conversionFlags )
+{
+    int rw=sw, rh=sh;
+
+    if (rw == -1)
+        rw = image.width();
+    if (rh == -1)
+        rh = image.height();
+
+//    fillRect(x,y,rw,rh,Qt::color1);
+}
+
 Meter::~Meter()
 {
 }
Index: src/imagelabel_python.cpp
===================================================================
--- src/imagelabel_python.cpp	(revision 551150)
+++ src/imagelabel_python.cpp	(working copy)
@@ -60,8 +60,10 @@
   theme->setSensor(LineParser(file), tmp);
   theme->meterList->append (tmp);
   theme->imageList->append (tmp);
+#ifdef USE_KROOT
   if(bg)
     theme->kroot->repaint(true);
+#endif
   return tmp;
 }
 
Index: src/textlabel.cpp
===================================================================
--- src/textlabel.cpp	(revision 551150)
+++ src/textlabel.cpp	(working copy)
@@ -287,7 +287,8 @@
   return true;
 }
 
-void TextLabel::mUpdate(QPainter *p)
+//void TextLabel::mUpdate(QPainter *p)
+void TextLabel::mUpdate(MeterPainter *p)
 {
   if (hidden != 1)
   {
Index: src/karamba.h
===================================================================
--- src/karamba.h	(revision 551150)
+++ src/karamba.h	(working copy)
@@ -24,6 +24,12 @@
 #ifndef _KARAMBA_H_
 #define _KARAMBA_H_
 
+/*
+#ifndef USE_KROOT
+#define USE_KROOT
+#endif // USE_KROOT
+*/
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -132,7 +138,9 @@
     KPopupMenu* keditpop;
     KPopupMenu *kpop;
     QBitmap* widgetMask;
+#ifdef USE_KROOT
     KarambaRootPixmap *kroot;
+#endif // USE_KROOT
     TaskManager taskManager;
     Systemtray* systray;
     KProcess* currProcess;
@@ -188,6 +196,7 @@
     void mouseMoveEvent( QMouseEvent *);
     void keyPressEvent ( QKeyEvent * e );
     void closeEvent ( QCloseEvent *);
+    void updateMask();
     void paintEvent ( QPaintEvent *);
     void saveProperties(KConfig *);
     void readProperties(KConfig *);
@@ -231,8 +240,13 @@
     QCString appId;
 
     QPixmap pm;
+    QBitmap mask;
     QPixmap background;
+#ifdef USE_KROOT
     QPainter p;
+#else
+    MeterPainter p;
+#endif // USE_KROOT
 
     QPoint clickPos;
     KActionCollection* accColl;
Index: src/clickarea.cpp
===================================================================
--- src/clickarea.cpp	(revision 551150)
+++ src/clickarea.cpp	(working copy)
@@ -79,7 +79,8 @@
     return rect;
 }
 
-void ClickArea::mUpdate( QPainter *p )
+//void ClickArea::mUpdate( QPainter *p )
+void ClickArea::mUpdate( MeterPainter *p )
 {
 
     p->drawRect(boundingBox);
Index: src/meter.h
===================================================================
--- src/meter.h	(revision 551150)
+++ src/meter.h	(working copy)
@@ -10,6 +10,8 @@
 #ifndef METER_H
 #define METER_H
 
+#include <qbitmap.h>
+#include <qimage.h>
 #include <qpixmap.h>
 #include <qpainter.h>
 #include <qstring.h>
@@ -20,6 +22,44 @@
 
 class karamba;
 
+QBitmap convertToMask(const QPixmap &pixmap);
+class MeterPainter : public QPainter
+{
+  protected:
+    bool masklock;
+
+  public:
+    MeterPainter();
+    void setMaskLock(bool lock);
+    bool maskLock();
+    void setPen( const QPen& pen);
+
+    void drawImage( int x,
+                    int y,
+                    const QImage & image,
+                    int sx = 0,
+                    int sy = 0,
+                    int sw = -1,
+                    int sh = -1,
+                    int conversionFlags = 0 );
+
+     void drawPixmap( int x,
+                     int y,
+                     const QPixmap & pixmap,
+                     int sx=0,
+                     int sy=0,
+                     int sw=-1,
+                     int sh=-1 );
+
+    void drawTiledPixmap ( int x,
+                           int y,
+                           int w,
+                           int h,
+                           const QPixmap & pixmap,
+                           int sx = 0,
+                           int sy = 0 ) ;
+};
+
 class Meter : public QObject
 {
 Q_OBJECT
@@ -46,7 +86,11 @@
 
   void setThemePath( QString );
 
+#ifdef USE_KROOT
   virtual void mUpdate(QPainter *)=0 ;
+#else
+  virtual void mUpdate(MeterPainter *)=0 ;  /* fixes fluxbox issue */
+#endif //USE_KROOT
 
   virtual void setValue(int) {};
   virtual int getValue() { return -1; };
Index: src/textlabel.h
===================================================================
--- src/textlabel.h	(revision 551150)
+++ src/textlabel.h	(working copy)
@@ -42,7 +42,8 @@
     void setAlignment( QString );
     void setFixedPitch( bool );
     void setShadow( int );
-    void mUpdate( QPainter * );
+    //void mUpdate( QPainter * );
+    void mUpdate( MeterPainter * );
 
     virtual void show();
     virtual void hide();
Index: src/bar.cpp
===================================================================
--- src/bar.cpp	(revision 551150)
+++ src/bar.cpp	(working copy)
@@ -107,7 +107,8 @@
   vertical = b;
 }
 
-void Bar::mUpdate(QPainter *p)
+//void Bar::mUpdate(QPainter *p)
+void Bar::mUpdate(MeterPainter *p)
 {
   int x, y, width, height;
   x = getX();
Index: src/input_python.h
===================================================================
--- src/input_python.h	(revision 551150)
+++ src/input_python.h	(working copy)
@@ -432,44 +432,44 @@
 PyObject* py_getInputBoxFontSize(PyObject *, PyObject *args);
 
 /** InputBox/setInputFocus
- *
- * SYNOPSIS
- *   long setInputFocus(widget, inputBox)
- * DESCRIPTION
- *   Sets the Input Focus to the Input Box
- * ARGUMENTS
- *   * long widget -- karamba
- *   * long inputBox -- pointer to Input Box
- * RETURN VALUE
- *   1 if successful
- */
+*
+* SYNOPSIS
+*   long setInputFocus(widget, inputBox)
+* DESCRIPTION
+*   Sets the Input Focus to the Input Box
+* ARGUMENTS
+*   * long widget -- karamba
+*   * long inputBox -- pointer to Input Box
+* RETURN VALUE
+*   1 if successful
+*/
 PyObject* py_setInputFocus(PyObject *, PyObject *args);
 
 /** InputBox/clearInputFocus
- *
- * SYNOPSIS
- *   long clearInputFocus(widget, inputBox)
- * DESCRIPTION
- *   releases the Input Focus from the Input Box
- * ARGUMENTS
- *   * long widget -- karamba
- *   * long inputBox -- pointer to Input Box
- * RETURN VALUE
- *   1 if successful
- */
+*
+* SYNOPSIS
+*   long clearInputFocus(widget, inputBox)
+* DESCRIPTION
+*   releases the Input Focus from the Input Box
+* ARGUMENTS
+*   * long widget -- karamba
+*   * long inputBox -- pointer to Input Box
+* RETURN VALUE
+*   1 if successful
+*/
 PyObject* py_clearInputFocus(PyObject *, PyObject *args);
 
 /** InputBox/getInputFocus
- *
- * SYNOPSIS
- *   long getInputFocus(widget)
- * DESCRIPTION
- *   Get the Input Box currently focused
- * ARGUMENTS
- *   * long widget -- karamba
- * RETURN VALUE
- *   the input box or 0
- */
+*
+* SYNOPSIS
+*   long getInputFocus(widget)
+* DESCRIPTION
+*   Get the Input Box currently focused
+* ARGUMENTS
+*   * long widget -- karamba
+* RETURN VALUE
+*   the input box or 0
+*/
 PyObject* py_getInputFocus(PyObject *, PyObject *args);
 
 #endif
Index: src/imagelabel.cpp
===================================================================
--- src/imagelabel.cpp	(revision 551150)
+++ src/imagelabel.cpp	(working copy)
@@ -323,7 +323,8 @@
   rect_off = QRect(getX(),getY(),pixmapWidth,pixmapHeight);
 }
 
-void ImageLabel::mUpdate(QPainter* p, int backgroundUpdate)
+//void ImageLabel::mUpdate(QPainter* p, int backgroundUpdate)
+void ImageLabel::mUpdate(MeterPainter *p, int backgroundUpdate)
 {
   if (backgroundUpdate == 1)
   {
@@ -353,7 +354,8 @@
   }
 }
 
-void ImageLabel::mUpdate(QPainter* p)
+//void ImageLabel::mUpdate(QPainter* p)
+void ImageLabel::mUpdate(MeterPainter *p)
 {
   //only draw image if not hidden
   if (hidden == 0 && background == 0)
Index: src/clickarea.h
===================================================================
--- src/clickarea.h	(revision 551150)
+++ src/clickarea.h	(working copy)
@@ -53,7 +53,8 @@
 
     QRect getRectangle();
 
-    void mUpdate( QPainter* );
+    //void mUpdate( QPainter* );
+    void mUpdate( MeterPainter * );
     void setValue( int );
     void setValue( QString );
 
Index: src/widget_python.cpp
===================================================================
--- src/widget_python.cpp	(revision 551150)
+++ src/widget_python.cpp	(working copy)
@@ -101,7 +101,9 @@
 long redrawWidgetBackground(long widget)
 {
   karamba* currTheme = (karamba*)widget;
+#ifdef USE_KROOT
   currTheme->kroot->repaint(true);
+#endif
   return 1;
 }
 
Index: src/clickmap.h
===================================================================
--- src/clickmap.h	(revision 551150)
+++ src/clickmap.h	(working copy)
@@ -28,7 +28,8 @@
     ~ClickMap();
 
     virtual bool click( QMouseEvent* );
-    void mUpdate( QPainter* );
+    //void mUpdate( QPainter* );
+    void mUpdate( MeterPainter * );
     void setValue( QString );
     void setValue( int );
     void setTextProps( TextField * );
Index: src/richtextlabel.cpp
===================================================================
--- src/richtextlabel.cpp	(revision 551150)
+++ src/richtextlabel.cpp	(working copy)
@@ -140,7 +140,8 @@
     setHeight(text->height());
 }
 
-void RichTextLabel::mUpdate(QPainter* p)
+//void RichTextLabel::mUpdate(QPainter* p)
+void RichTextLabel::mUpdate(MeterPainter *p)
 {
   if (hidden || text == 0)
   {
Index: src/input.h
===================================================================
--- src/input.h	(revision 551150)
+++ src/input.h	(working copy)
@@ -42,7 +42,8 @@
 
   ~Input();
 
-  void mUpdate(QPainter *p);
+  //void mUpdate(QPainter *p);
+  void mUpdate(MeterPainter *p);
 
   void setValue(QString text);
   QString getStringValue() const;
Index: src/graph.h
===================================================================
--- src/graph.h	(revision 551150)
+++ src/graph.h	(working copy)
@@ -27,7 +27,8 @@
   void setValue( int );
   int getValue() { return lastValue; };
   void setValue( QString );
-  void mUpdate( QPainter * );
+  //void mUpdate( QPainter * );
+  void mUpdate( MeterPainter * );
 
 private:
   int lastValue;
Index: src/bar.h
===================================================================
--- src/bar.h	(revision 551150)
+++ src/bar.h	(working copy)
@@ -22,7 +22,8 @@
     Bar(karamba* k,int ix,int iy,int iw,int ih );
     ~Bar();
 
-    void mUpdate( QPainter * );
+    //void mUpdate( QPainter * );
+    void mUpdate( MeterPainter * );
 
     virtual void setMax( int m );
     virtual void setMin( int m );
Index: src/clickmap.cpp
===================================================================
--- src/clickmap.cpp	(revision 551150)
+++ src/clickmap.cpp	(working copy)
@@ -53,7 +53,8 @@
   return false;
 }
 
-void ClickMap::mUpdate( QPainter *p )
+//void ClickMap::mUpdate( QPainter *p )
+void ClickMap::mUpdate( MeterPainter *p )
 {
     int i = 0; //text.getLineHeight();
     int row = 1;
Index: src/imagelabel.h
===================================================================
--- src/imagelabel.h	(revision 551150)
+++ src/imagelabel.h	(working copy)
@@ -115,8 +115,10 @@
 
   void rotate(int);
   void removeImageTransformations();
-  void mUpdate( QPainter * );
-  void mUpdate( QPainter *, int );
+  //void mUpdate( QPainter * );
+  //void mUpdate( QPainter *, int );
+  void mUpdate( MeterPainter * );
+  void mUpdate( MeterPainter *, int );
   
   void rolloverImage(QMouseEvent *e);
   void parseImages( QString fn, QString fn_roll, int, int, int, int );
