diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-08-11 11:58:29 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-09-02 06:20:10 (GMT) |
commit | e96078a01ea7a2a79b07bf6ab7ebd17eafa38560 (patch) | |
tree | 182aa4d93ad4af7f7c45bedf2f26fa75e6e96d5c /src | |
parent | 6af3e3bd7c3c86085eddfd900ef48ea7d616d34f (diff) | |
download | Qt-e96078a01ea7a2a79b07bf6ab7ebd17eafa38560.zip Qt-e96078a01ea7a2a79b07bf6ab7ebd17eafa38560.tar.gz Qt-e96078a01ea7a2a79b07bf6ab7ebd17eafa38560.tar.bz2 |
Ensure native window is considered invisible when it gets destroyed
The lifetime of the backing store depends, on Symbian, on the visibility
of the native windows which are rendering from it. Specifically, once
all such windows (i.e. the TLW window and those of any native widget
descendents) have become invisible, the backing store is deleted.
During re-parenting of a visible native child widget from parent1 to
parent2, the following events occur:
1. QWidget::hide() is called on the child
2. The child widget's native control is deleted
3. A new native control is created, with its parent set as
parent2->window()->effectiveWinId()
Because there is no yield to the event loop between (1) and (2), the
application does not receive a 'window hidden' notification as a
result of the call to hide(). This means that the child widget is
not removed from the list of visible widgets held in the backing store
of parent1->window().
This patch ensures that the child is removed from this list during
between steps (1) and (2).
Task-number: QTBUG-12406
Task-number: QTBUG-12817
Reviewed-by: Jason Barron
(cherry picked from commit bc1c472967c78579178cf7e98ab999842fee3102)
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 2818d88..1520c82 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -684,6 +684,12 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) QSymbianControl *old_winid = static_cast<QSymbianControl *>(wasCreated ? data.winid : 0); if ((q->windowType() == Qt::Desktop)) old_winid = 0; + + // old_winid may not have received a 'not visible' visibility + // changed event before being destroyed; make sure that it is + // removed from the backing store's list of visible windows. + S60->controlVisibilityChanged(old_winid, false); + setWinId(0); // hide and reparent our own window away. Otherwise we might get |