summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-08-25 12:44:45 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-08-25 12:54:55 (GMT)
commit4c9212cdf38b35e89311416436f1e60b818b69c3 (patch)
tree6e47821da2d13b9405be3a30e0b6eee96917d634
parentd9dd68c4400c3ca590ea425d6f3d070ea6094099 (diff)
downloadQt-4c9212cdf38b35e89311416436f1e60b818b69c3.zip
Qt-4c9212cdf38b35e89311416436f1e60b818b69c3.tar.gz
Qt-4c9212cdf38b35e89311416436f1e60b818b69c3.tar.bz2
Enabling AdvancedPointerEvents for active windows causes a panic
In Symbian port of Qt, widgets that have attribute WA_AcceptTouchEvents, are tried to set as enabled for "advanced pointer events". These are multitouch events. However, the event enablation cannot be done after a window has been activated. Current implementation causes a crash in certain cases. For example, a treewidget that is inside a inactive tab page, causes a crash when tab page is selected. The crash is worked around, by not allowing a active window to enable advanced pointer events. This fixes http://bugreports.qt.nokia.com/browse/QTBUG-12779 Task-number: QTBUG-12779 Reviewed-by: mread
-rw-r--r--src/gui/kernel/qapplication_s60.cpp5
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp9
3 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 7c5e790..e197dc5 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1344,6 +1344,11 @@ void QSymbianControl::setFocusSafely(bool focus)
}
}
+bool QSymbianControl::isControlActive()
+{
+ return IsActivated() ? true : false;
+}
+
/*!
\typedef QApplication::QS60MainApplicationFactory
\since 4.6
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index ad6a99a..eb1aa18 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -211,6 +211,8 @@ public:
void setFocusSafely(bool focus);
+ bool isControlActive();
+
#ifdef Q_WS_S60
void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
void HandleStatusPaneSizeChange();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 7494f92..fc13c93 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -366,7 +366,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
// Symbian windows are always created in an inactive state
// We perform this assignment for the case where the window is being re-created
- // as aa result of a call to setParent_sys, on either this widget or one of its
+ // as a result of a call to setParent_sys, on either this widget or one of its
// ancestors.
extra->activated = 0;
@@ -410,7 +410,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
// Symbian windows are always created in an inactive state
// We perform this assignment for the case where the window is being re-created
- // as aa result of a call to setParent_sys, on either this widget or one of its
+ // as a result of a call to setParent_sys, on either this widget or one of its
// ancestors.
extra->activated = 0;
@@ -954,7 +954,10 @@ void QWidgetPrivate::registerTouchWindow()
Q_Q(QWidget);
if (q->testAttribute(Qt::WA_WState_Created) && q->windowType() != Qt::Desktop) {
RWindow *rwindow = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
- rwindow->EnableAdvancedPointers();
+ QSymbianControl *window = static_cast<QSymbianControl *>(q->effectiveWinId());
+ //Enabling advanced pointer events for controls that already have active windows causes a panic.
+ if (!window->isControlActive())
+ rwindow->EnableAdvancedPointers();
}
#endif
}