audio selection - fake
[enigma2.git] / lib / gui / ewidgetdesktop.cpp
index 1c65d5d..afe1995 100644 (file)
@@ -36,7 +36,7 @@ int eWidgetDesktop::movedWidget(eWidget *root)
        if ((m_comp_mode == cmBuffered) && (root->m_comp_buffer))
        {
                root->m_comp_buffer->m_position = root->position();
-               redrawComposition(0);
+//             redrawComposition(0);
                return 0;
        }
        
@@ -66,6 +66,8 @@ void eWidgetDesktop::calcWidgetClipRegion(eWidget *widget, gRegion &parent_visib
        for (ePtrList<eWidget>::iterator i(widget->m_childs.begin()); i != widget->m_childs.end(); ++i)
                if (i->m_vis & eWidget::wVisShow)
                        calcWidgetClipRegion(*i, widget->m_visible_region);
+               else
+                       clearVisibility(*i);
 }
 
 void eWidgetDesktop::recalcClipRegions(eWidget *root)
@@ -79,7 +81,10 @@ void eWidgetDesktop::recalcClipRegions(eWidget *root)
                for (ePtrList<eWidget>::iterator i(m_root.begin()); i != m_root.end(); ++i)
                {
                        if (!(i->m_vis & eWidget::wVisShow))
+                       {
+                               clearVisibility(i);
                                continue;
+                       }
                        
                        gRegion visible_before = i->m_visible_with_childs;
 
@@ -94,8 +99,14 @@ void eWidgetDesktop::recalcClipRegions(eWidget *root)
                
                gRegion redraw = (background_before - m_screen.m_background_region) | (m_screen.m_background_region - background_before);
                invalidate(redraw);
-       } else
+       } else if (m_comp_mode == cmBuffered)
        {
+               if (!root->m_vis & eWidget::wVisShow)
+               {
+                       clearVisibility(root);
+                       removeBufferForWidget(root);
+                       return;
+               }
                if ((!root->m_comp_buffer) || (root->size() != root->m_comp_buffer->m_screen_size))
                        createBufferForWidget(root);
 
@@ -203,7 +214,6 @@ void eWidgetDesktop::paintBackground(eWidgetDesktopCompBuffer *comp)
 
 void eWidgetDesktop::paint()
 {
-       eDebug("paint");
        m_require_redraw = 0;
        
                /* walk all root windows. */
@@ -230,8 +240,7 @@ void eWidgetDesktop::paint()
        
        if (m_comp_mode == cmBuffered)
        {
-               eDebug("redraw composition");
-               redrawComposition(0);
+//             redrawComposition(0);
        }
 }
 
@@ -263,7 +272,7 @@ void eWidgetDesktop::makeCompatiblePixmap(gPixmap &pm)
        if (m_comp_mode != cmImmediate)
                return;
        
-       eDebug("widgetDesktop: make compatible pixmap of %p\n", &pm);
+//     eDebug("widgetDesktop: make compatible pixmap of %p", &pm);
        if (!m_screen.m_dc)
        {
                eWarning("eWidgetDesktop: no DC to make pixmap compatible with!");
@@ -384,3 +393,10 @@ void eWidgetDesktop::notify()
 {
        redrawComposition(1);
 }
+
+void eWidgetDesktop::clearVisibility(eWidget *widget)
+{
+       widget->m_visible_with_childs = gRegion();
+       for (ePtrList<eWidget>::iterator i(widget->m_childs.begin()); i != widget->m_childs.end(); ++i)
+               clearVisibility(*i);
+}