summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-09-29 10:53:32 (GMT)
committeraxis <qt-info@nokia.com>2009-09-30 13:27:14 (GMT)
commita93d0d1f970689991dd113d696e922854ff9ec6a (patch)
tree7ca564e5e68ac52572ac3ec0bb7f6b1b27b95f12 /src/gui
parent75666d254304746ead69892e92fa4ab39d219df1 (diff)
downloadQt-a93d0d1f970689991dd113d696e922854ff9ec6a.zip
Qt-a93d0d1f970689991dd113d696e922854ff9ec6a.tar.gz
Qt-a93d0d1f970689991dd113d696e922854ff9ec6a.tar.bz2
Revert "Switched to asynchronous focus handling on Symbian."
This reverts commit b6377f43410b14125a66ffd02acde69cfb6e455e. The asynchronous handling caused too many headaches with input methods, which expect the focus status to be updated immediately. This may break the test case that was originally fixed by this patch (I cannot find out which one at the moment), but that will have to be solved in a different way. Conflicts: src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qcoreevent.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/kernel/qwidget_s60.cpp
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp18
-rw-r--r--src/gui/kernel/qwidget.cpp6
-rw-r--r--src/gui/kernel/qwidget_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp28
4 files changed, 16 insertions, 39 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 0650f6c..498b1e7 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -845,8 +845,22 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
|| (qwidget->windowType() & Qt::Popup) == Qt::Popup)
return;
- QEvent *deferredFocusEvent = new QEvent(QEvent::SymbianDeferredFocusChanged);
- QApplication::postEvent(qwidget, deferredFocusEvent);
+ if (IsFocused()) {
+ QApplication::setActiveWindow(qwidget);
+#ifdef Q_WS_S60
+ // If widget is fullscreen, hide status pane and button container
+ // otherwise show them.
+ CEikStatusPane* statusPane = S60->statusPane();
+ CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
+ bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
+ if (statusPane && (statusPane->IsVisible() == isFullscreen))
+ statusPane->MakeVisible(!isFullscreen);
+ if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
+ buttonGroup->MakeVisible(!isFullscreen);
+#endif
+ } else {
+ QApplication::setActiveWindow(0);
+ }
}
void QSymbianControl::HandleResourceChange(int resourceType)
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 08fe5b9..45b0dac 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8336,12 +8336,6 @@ bool QWidget::event(QEvent *event)
(void) QApplication::sendEvent(this, &mouseEvent);
break;
}
- case QEvent::SymbianDeferredFocusChanged: {
-#ifdef Q_OS_SYMBIAN
- d->handleSymbianDeferredFocusChanged();
-#endif
- break;
- }
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 296c5b1..15f316d 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -286,9 +286,6 @@ public:
QPalette naturalWidgetPalette(uint inheritedMask) const;
void setMask_sys(const QRegion &);
-#ifdef Q_OS_SYMBIAN
- void handleSymbianDeferredFocusChanged();
-#endif
void raise_sys();
void lower_sys();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 6b5e9b7..f64263b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -367,34 +367,6 @@ void QWidgetPrivate::setFocus_sys()
q->effectiveWinId()->SetFocus(true);
}
-void QWidgetPrivate::handleSymbianDeferredFocusChanged()
-{
- Q_Q(QWidget);
- WId control = q->internalWinId();
- if (!control) {
- // This could happen if the widget was reparented, while the focuschange
- // was in the event queue.
- return;
- }
-
- if (control->IsFocused()) {
- QApplication::setActiveWindow(q);
-#ifdef Q_WS_S60
- // If widget is fullscreen, hide status pane and button container
- // otherwise show them.
- CEikStatusPane* statusPane = S60->statusPane();
- CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
- bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
- if (statusPane && (statusPane->IsVisible() == isFullscreen))
- statusPane->MakeVisible(!isFullscreen);
- if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
- buttonGroup->MakeVisible(!isFullscreen);
-#endif
- } else {
- QApplication::setActiveWindow(0);
- }
-}
-
void QWidgetPrivate::raise_sys()
{
Q_Q(QWidget);