X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/53f15d8fcdb34a547c4ee99625bb31fcf99d5619..6f55cd01cf53108209c299e66c2fe189dc61a344:/lib/gui/ewidget.cpp diff --git a/lib/gui/ewidget.cpp b/lib/gui/ewidget.cpp index 26ccfba3..3bc6e663 100644 --- a/lib/gui/ewidget.cpp +++ b/lib/gui/ewidget.cpp @@ -32,6 +32,9 @@ void eWidget::move(ePoint pos) if (m_position == pos) return; + /* ?? what about native move support? */ + invalidate(); + m_position = pos; event(evtChangedPosition); @@ -137,6 +140,8 @@ void eWidget::hide() while (root && !root->m_desktop) { root = root->m_parent; + if (!root) + return; abspos += root->position(); } assert(root->m_desktop); @@ -202,12 +207,11 @@ eWidget::~eWidget() m_parent = 0; - /* destroy all childs */ + /* tell all childs that the parent is not anymore existing */ ePtrList::iterator i(m_childs.begin()); while (i != m_childs.end()) { - (*i)->m_parent = 0; - delete *i; + (*i)->parentRemoved(); i = m_childs.erase(i); } } @@ -272,6 +276,11 @@ void eWidget::recalcClipRegionsWhenVisible() } while(1); } +void eWidget::parentRemoved() +{ + m_parent = 0; +} + int eWidget::event(int event, void *data, void *data2) { switch (event)