diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-03-27 10:36:16 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-03-27 10:44:28 (GMT) |
commit | 5d4c541cc308239e7f8d6e77d837cc1b2a1a7ebc (patch) | |
tree | 10ac03f50fe8dced8bcab6c3307a2d0ef952b5bd | |
parent | e83fce3f50f646fa1d3daf6dabffa47045290a44 (diff) | |
download | Qt-5d4c541cc308239e7f8d6e77d837cc1b2a1a7ebc.zip Qt-5d4c541cc308239e7f8d6e77d837cc1b2a1a7ebc.tar.gz Qt-5d4c541cc308239e7f8d6e77d837cc1b2a1a7ebc.tar.bz2 |
Creating a native window handle doesn't reset input context on X11.
When the current focus widget enforces the creation of the native
window handle we should reset the input context.
Task-number: 249578
Reviewed-by: Brad
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dcb48cc..09162ee 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -9793,12 +9793,21 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) } break; #endif - case Qt::WA_NativeWindow: + case Qt::WA_NativeWindow: { + QInputContext *ic = 0; + if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) { + ic = d->inputContext(); + ic->reset(); + ic->setFocusWidget(0); + } if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget()) parentWidget()->d_func()->enforceNativeChildren(); if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created)) d->createWinId(); + if (ic) + ic->setFocusWidget(this); break; + } case Qt::WA_PaintOnScreen: d->updateIsOpaque(); #if defined(Q_WS_WIN) || defined(Q_WS_X11) |