diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-02-09 09:41:29 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-02-09 17:01:36 (GMT) |
commit | 46df42af1a25fd06247bb96d9e0bf24bf19defe8 (patch) | |
tree | 59b847c3464e5a64f3a1303f4127a46cfe9659dd /src/gui/painting | |
parent | 33aa8f4a035c1ce9231b40844e6e0793205d12aa (diff) | |
download | Qt-46df42af1a25fd06247bb96d9e0bf24bf19defe8.zip Qt-46df42af1a25fd06247bb96d9e0bf24bf19defe8.tar.gz Qt-46df42af1a25fd06247bb96d9e0bf24bf19defe8.tar.bz2 |
Fixed defect in handling of expose events for Symbian
Commit bc82db did not correctly handle native child widgets.
Consider the case when we have a top-level widget A with a native
child widget B. When QSymbianControl::Draw() is called on the
control corresponding to B, the following occurs:
1. The inExpose flag is set in B's QWExtra structure.
2. The call to syncBackingStore() results in a call to
QWidgetBackingStore::flush(), passing default parameters.
3. Because no target widget was passed to flush(), this
function selects the top-level widget (A) as the target for
the flush operation, passing A as the first argument of
QS60WindowSurface::flush().
4. QS60WindowSurface::flush() checks the inExpose flag from A's
QWExtra structure, finds it to be false, and proceeds to
call DrawNow() on A's control.
Because QSymbianControl::Draw() uses the default graphics context,
this context is shared between controls. This means that the DrawNow()
call in step 4 causes a WSERV-10 panic (Activate() called on an
already-active) graphics context.
This patch moves the inExpose flag from B's QWExtra into A's QTLWExtra,
with the result that the call to DrawNow() in step 4 is suppressed.
Task-number: QTBUG-7960
Reviewed-by: axis
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index b41dc2c..6cbf3d9 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -145,12 +145,15 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget) void QS60WindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &) { - QWExtra *extra = widget->d_func()->extraData(); - if (extra && !extra->inExpose) { - extra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again + QWidget *window = widget->window(); + Q_ASSERT(window); + QTLWExtra *topExtra = window->d_func()->maybeTopData(); + Q_ASSERT(topExtra); + if (!topExtra->inExpose) { + topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again TRect tr = qt_QRect2TRect(region.boundingRect()); widget->winId()->DrawNow(tr); - extra->inExpose = false; + topExtra->inExpose = false; } } |