diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-04-29 07:42:16 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-04-29 07:42:16 (GMT) |
commit | ee45a77ce45011b09a2984df007941460245a534 (patch) | |
tree | 42313b0f47fbdda5d2b5a9342102ec576899d797 | |
parent | 06b103c81a28237a568b3392e5e7954bb1ec7b1d (diff) | |
parent | 27e57ccd327fbc1edbb23d9959c5388023974dfc (diff) | |
download | Qt-ee45a77ce45011b09a2984df007941460245a534.zip Qt-ee45a77ce45011b09a2984df007941460245a534.tar.gz Qt-ee45a77ce45011b09a2984df007941460245a534.tar.bz2 |
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 35 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 7 |
2 files changed, 29 insertions, 13 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b021b1c..c7bbcdb 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -531,6 +531,9 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const void QSymbianControl::Draw(const TRect& r) const { QWindowSurface *surface = qwidget->windowSurface(); + if (!surface) + return; + QPaintEngine *engine = surface->paintDevice()->paintEngine(); if (!engine) return; @@ -948,6 +951,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event) // Qt event handling. Handle some events regardless of if the handle is in our // widget map or not. CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle()); + const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control); switch (event->Type()) { #ifndef QT_NO_IM case EEventKey: @@ -970,17 +974,12 @@ int QApplication::s60ProcessEvent(TWsEvent *event) } #endif case EEventPointerEnter: - if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control)) - { - // Qt::Enter will be generated in HandlePointerL - return 1; - } + if (controlInMap) + return 1; // Qt::Enter will be generated in HandlePointerL break; case EEventPointerExit: - if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control)) - { - if (S60) - { + if (controlInMap) { + if (S60) { // mouseEvent outside our window, send leave event to last focused widget QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos, Qt::NoButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); @@ -995,11 +994,27 @@ int QApplication::s60ProcessEvent(TWsEvent *event) if (S60) S60->updateScreenSize(); return 0; // Propagate to CONE + case EEventWindowVisibilityChanged: + if (controlInMap) { + const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); + QWidget *w = QWidgetPrivate::mapper->value(control); + if (!w->d_func()->maybeTopData()) + break; + if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { + delete w->d_func()->topData()->backingStore; + w->d_func()->topData()->backingStore = 0; + } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) + && !w->d_func()->maybeBackingStore()) { + w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); + } + return 1; + } + break; default: break; } - if (!QWidgetPrivate::mapper || !QWidgetPrivate::mapper->contains(control)) + if (!controlInMap) return -1; return 0; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 116dc35..ec80a18 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -195,12 +195,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO data.crect.moveTopLeft(QPoint(clientRect.iTl.iX, clientRect.iTl.iY)); QSymbianControl *control= new QSymbianControl(q); control->ConstructL(true,desktop); - if (!desktop) - { + if (!desktop) { QTLWExtra *topExtra = topData(); topExtra->rwindow = control->DrawableWindow(); // Request mouse move events. - topExtra->rwindow->PointerFilter(EPointerFilterEnterExit | EPointerFilterMove | EPointerFilterDrag, 0); + topExtra->rwindow->PointerFilter(EPointerFilterEnterExit + | EPointerFilterMove | EPointerFilterDrag, 0); + topExtra->rwindow->EnableVisibilityChangeEvents(); } id = (WId)control; |