diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-03 02:47:41 +0200 |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-03 02:47:41 +0200 |
commit | 7c6afcb1cf9db23f7a8bb04c68d58b3581ebd7b5 (patch) | |
tree | fc4d5a51335f0a88e13600f10b449ca13ab814d1 /src/gui/kernel/qapplication_s60.cpp | |
parent | 932b4b95cf4c7cc250b2c3f23d9b903292f84ab4 (diff) | |
parent | 6acfea19d4c00150602c152943d89bf429462c39 (diff) |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Removed compiler warnings
Window visibility changes update TLW backing store reference count
Enable visibility change events on all Symbian native windows
Added reference counting to QWidgetBackingStore
Added tst_QWidget::destroyBackingStoreWhenHidden
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b1e0f63d0f..78027b2752 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1703,19 +1703,27 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent return 1; const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); QWidget *w = QWidgetPrivate::mapper->value(control); - if (!w->d_func()->maybeTopData()) + QWidget *const window = w->window(); + if (!window->d_func()->maybeTopData()) break; + QRefCountedWidgetBackingStore &backingStore = window->d_func()->maybeTopData()->backingStore; if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { - delete w->d_func()->topData()->backingStore; - w->d_func()->topData()->backingStore = 0; + // Decrement backing store reference count + backingStore.deref(); // In order to ensure that any resources used by the window surface // are immediately freed, we flush the WSERV command buffer. S60->wsSession().Flush(); - } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) - && !w->d_func()->maybeBackingStore()) { - w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); - w->d_func()->invalidateBuffer(w->rect()); - w->repaint(); + } else if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) { + if (backingStore.data()) { + // Increment backing store reference count + backingStore.ref(); + } else { + // Create backing store with an initial reference count of 1 + backingStore.create(window); + backingStore.ref(); + w->d_func()->invalidateBuffer(w->rect()); + w->repaint(); + } } return 1; } |