summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-08-11 11:58:29 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-08-18 10:12:51 (GMT)
commitbc1c472967c78579178cf7e98ab999842fee3102 (patch)
tree6d99050a41644b436fb6419bc1e3e55858317cd5 /src/gui
parentea85300f6456ef1bd9702296f3068edf0795736e (diff)
downloadQt-bc1c472967c78579178cf7e98ab999842fee3102.zip
Qt-bc1c472967c78579178cf7e98ab999842fee3102.tar.gz
Qt-bc1c472967c78579178cf7e98ab999842fee3102.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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 56349ad..319f330 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