summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 09:01:08 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-01 13:10:55 (GMT)
commit3ab68cbf5436e3e66d0297b01af661bedecb8766 (patch)
tree853a597d8d6e8509f80b9749b3087cf0e5ea3089 /src/gui/inputmethod
parentf3dbe7d3ebac51b32cf7cc227032fa87a087c682 (diff)
downloadQt-3ab68cbf5436e3e66d0297b01af661bedecb8766.zip
Qt-3ab68cbf5436e3e66d0297b01af661bedecb8766.tar.gz
Qt-3ab68cbf5436e3e66d0297b01af661bedecb8766.tar.bz2
Give input context focus only when widget is enabled.
When disabling a widget that accepts keyboard input we disable input context by calling QInputContext::setFocusWidget(0). Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qximinputcontext_x11.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp
index 1c8560f..b43a134 100644
--- a/src/gui/inputmethod/qximinputcontext_x11.cpp
+++ b/src/gui/inputmethod/qximinputcontext_x11.cpp
@@ -437,7 +437,9 @@ void QXIMInputContext::create_xim()
// reinitialize input context after the input method
// server (like SCIM) has been launched without
// requiring the user to manually switch focus.
- if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled))
+ if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
+ && focusWidget->testAttribute(Qt::WA_WState_Created)
+ && focusWidget->isEnabled())
setFocusWidget(focusWidget);
}
// following code fragment is not required for immodule