add getAbsolutePosition
[enigma2.git] / lib / gui / ewidget.cpp
index ef784997ef7dc9e7ae263bc4b7c2cb18b4b0662d..7c50f4af47344d2f0153c36d3de0062a0f19e12d 100644 (file)
@@ -199,6 +199,21 @@ void eWidget::setTransparent(int transp)
                m_vis &=~wVisTransparent;
 }
 
                m_vis &=~wVisTransparent;
 }
 
+ePoint eWidget::getAbsolutePosition()
+{
+       eWidget *root = this;
+       ePoint abspos = position();
+
+       while (root && !root->m_desktop)
+       {
+               root = root->m_parent;
+               assert(root);
+               abspos += root->position();
+       }
+
+       return abspos;
+}
+
 void eWidget::mayKillFocus()
 {
        setFocus(0);
 void eWidget::mayKillFocus()
 {
        setFocus(0);