summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-06-08 11:57:34 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-06-08 11:57:34 (GMT)
commitefc999e95a74eee7e282e8d34e681c5b18cb60ad (patch)
treeec7c36d96035845c5d018d8cda9c0500fe18d662
parentb3b5ae13763c97bad4bfcdda539acf8656c34938 (diff)
downloadQt-efc999e95a74eee7e282e8d34e681c5b18cb60ad.zip
Qt-efc999e95a74eee7e282e8d34e681c5b18cb60ad.tar.gz
Qt-efc999e95a74eee7e282e8d34e681c5b18cb60ad.tar.bz2
Avoid unnecessary calls to FocusChanged in Symbian.
Called setFocus only when the widget does not already have the focus. This should remove unncessary calls to FocusChanged since CCoeControl always calls FocusChanged when SetFocus is called, even there was no changes in focus.
-rw-r--r--src/gui/kernel/qwidget_s60.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 11cb974..e32e272 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -319,7 +319,8 @@ void QWidgetPrivate::hide_sys()
deactivateWidgetCleanup();
WId id = q->internalWinId();
if (q->isWindow() && id) {
- id->SetFocus(false);
+ if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ id->SetFocus(false);
id->MakeVisible(false);
id->ControlEnv()->AppUi()->RemoveFromStack(id);
if (QWidgetBackingStore *bs = maybeBackingStore())
@@ -335,7 +336,8 @@ void QWidgetPrivate::setFocus_sys()
{
Q_Q(QWidget);
if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup)
- q->effectiveWinId()->SetFocus(true);
+ if(!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ q->effectiveWinId()->SetFocus(true);
}
void QWidgetPrivate::raise_sys()
@@ -922,7 +924,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
releaseKeyboard();
if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) {
WId id = internalWinId();
- id->SetFocus(false);
+ if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged()
+ id->SetFocus(false);
id->ControlEnv()->AppUi()->RemoveFromStack(id);
CBase::Delete(id);