summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2010-03-05 14:40:04 (GMT)
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2010-03-05 14:40:04 (GMT)
commit8428a5e9dbe8f872ba229aad360c8579638479ae (patch)
tree375a02f52483999bcb65c513c4127b8d45349c59
parent3d51d223bee55011876d12011970a5ad15c4acd0 (diff)
downloadQt-8428a5e9dbe8f872ba229aad360c8579638479ae.zip
Qt-8428a5e9dbe8f872ba229aad360c8579638479ae.tar.gz
Qt-8428a5e9dbe8f872ba229aad360c8579638479ae.tar.bz2
Fix for QTBUG-6659 Parent window accepts pointer events wrongly
Parent window accepted pointer events even though the child was modal. That was because closing popup didn't restore pointer grab for modal window. Task-number: QTBUG-6659 Reviewed-by: axis
-rw-r--r--src/gui/kernel/qapplication_s60.cpp3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 2a90ba6..395ceca 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1473,6 +1473,9 @@ void QApplicationPrivate::closePopup(QWidget *popup)
QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget()
: q_func()->focusWidget();
if (fw) {
+ if(fw->window()->isModal()) // restore pointer capture for modal window
+ fw->effectiveWinId()->SetPointerCapture(true);
+
if (fw != q_func()->focusWidget()) {
fw->setFocus(Qt::PopupFocusReason);
} else {
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 7bbc142..7fb21d2 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1237,8 +1237,10 @@ void QWidget::releaseMouse()
{
if (!qt_nograb() && QWidgetPrivate::mouseGrabber == this) {
Q_ASSERT(testAttribute(Qt::WA_WState_Created));
- WId id = effectiveWinId();
- id->SetPointerCapture(false);
+ if(!window()->isModal()) {
+ WId id = effectiveWinId();
+ id->SetPointerCapture(false);
+ }
QWidgetPrivate::mouseGrabber = 0;
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();