summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp74
1 files changed, 41 insertions, 33 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 559bb6a..7c5e790 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -135,6 +135,38 @@ void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, boo
}
#endif
+void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
+{
+ if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control)) {
+ QWidget *const widget = QWidgetPrivate::mapper->value(control);
+ QWidget *const window = widget->window();
+ if (QTLWExtra *topData = qt_widget_private(window)->maybeTopData()) {
+ QWidgetBackingStoreTracker &backingStore = topData->backingStore;
+ if (visible) {
+ if (backingStore.data()) {
+ backingStore.registerWidget(widget);
+ } else {
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+ S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer);
+#endif
+ backingStore.create(window);
+ backingStore.registerWidget(widget);
+ qt_widget_private(widget)->invalidateBuffer(widget->rect());
+ widget->repaint();
+ }
+ } else {
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+ S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer);
+#endif
+ backingStore.unregisterWidget(widget);
+ // In order to ensure that any resources used by the window surface
+ // are immediately freed, we flush the WSERV command buffer.
+ S60->wsSession().Flush();
+ }
+ }
+ }
+}
+
bool qt_nograb() // application no-grab option
{
#if defined(QT_DEBUG)
@@ -1075,17 +1107,19 @@ void QSymbianControl::Draw(const TRect& controlRect) const
CFbsBitmap *bitmap = s60Surface->symbianBitmap();
CWindowGc &gc = SystemGc();
- switch(qwidget->d_func()->extraData()->nativePaintMode) {
+ QWExtra::NativePaintMode nativePaintMode = qwidget->d_func()->extraData()->nativePaintMode;
+ if(qwidget->d_func()->paintOnScreen())
+ nativePaintMode = QWExtra::Disable;
+
+ switch(nativePaintMode) {
case QWExtra::Disable:
// Do nothing
break;
-
case QWExtra::Blit:
if (qwidget->d_func()->isOpaque)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
break;
-
case QWExtra::ZeroFill:
if (Window().DisplayMode() == EColor16MA
|| Window().DisplayMode() == Q_SYMBIAN_ECOLOR16MAP) {
@@ -1098,7 +1132,6 @@ void QSymbianControl::Draw(const TRect& controlRect) const
gc.Clear(controlRect);
};
break;
-
default:
Q_ASSERT(false);
}
@@ -1922,35 +1955,10 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
if (callSymbianEventFilters(symbianEvent))
return 1;
const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
- QWidget *w = QWidgetPrivate::mapper->value(control);
- QWidget *const window = w->window();
- if (!window->d_func()->maybeTopData())
- break;
- QRefCountedWidgetBackingStore &backingStore = window->d_func()->maybeTopData()->backingStore;
- if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer);
-#endif
- // 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) {
- if (backingStore.data()) {
- // Increment backing store reference count
- backingStore.ref();
- } else {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer);
-#endif
- // Create backing store with an initial reference count of 1
- backingStore.create(window);
- backingStore.ref();
- w->d_func()->invalidateBuffer(w->rect());
- w->repaint();
- }
- }
+ if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible)
+ S60->controlVisibilityChanged(control, false);
+ else if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
+ S60->controlVisibilityChanged(control, true);
return 1;
}
break;