summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-04-02 12:16:45 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-12 05:56:59 (GMT)
commit49e63efd2a45e1872468d8d6de1308c96ee92fcb (patch)
treef03975735f6e8745d657ef2b147a9d63811309e3 /src/gui/inputmethod
parent44c14470e5b28e45c19d6959b114e063cf3f4d83 (diff)
downloadQt-49e63efd2a45e1872468d8d6de1308c96ee92fcb.zip
Qt-49e63efd2a45e1872468d8d6de1308c96ee92fcb.tar.gz
Qt-49e63efd2a45e1872468d8d6de1308c96ee92fcb.tar.bz2
Ensure that the IME composition is handled correctly on Mac
When the language menu was shown while IME composition was underway, it would cause the composition text to be in an invalid state. Task-number: QTBUG-25107 Change-Id: Iaf06f330fb055e30c25ccc9874f15132ea000bc2 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qmacinputcontext_mac.cpp4
-rw-r--r--src/gui/inputmethod/qmacinputcontext_p.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/inputmethod/qmacinputcontext_mac.cpp b/src/gui/inputmethod/qmacinputcontext_mac.cpp
index 5fa5e63..282013a 100644
--- a/src/gui/inputmethod/qmacinputcontext_mac.cpp
+++ b/src/gui/inputmethod/qmacinputcontext_mac.cpp
@@ -58,7 +58,7 @@ extern bool qt_sendSpontaneousEvent(QObject*, QEvent*);
QMacInputContext::QMacInputContext(QObject *parent)
: QInputContext(parent), composing(false), recursionGuard(false), textDocument(0),
- keydownEvent(0)
+ keydownEvent(0), lastFocusWid(0)
{
// createTextDocument();
}
@@ -141,6 +141,8 @@ bool QMacInputContext::isComposing() const
void QMacInputContext::setFocusWidget(QWidget *w)
{
+ if (!w)
+ lastFocusWid = focusWidget();
createTextDocument();
#ifndef QT_MAC_USE_COCOA
if(w)
diff --git a/src/gui/inputmethod/qmacinputcontext_p.h b/src/gui/inputmethod/qmacinputcontext_p.h
index 1387246..39d19ab 100644
--- a/src/gui/inputmethod/qmacinputcontext_p.h
+++ b/src/gui/inputmethod/qmacinputcontext_p.h
@@ -81,7 +81,7 @@ public:
EventRef lastKeydownEvent() { return keydownEvent; }
void setLastKeydownEvent(EventRef);
-
+ QWidget *lastFocusWidget() const { return lastFocusWid; }
protected:
void mouseHandler(int pos, QMouseEvent *);
private:
@@ -90,6 +90,7 @@ private:
TSMDocumentID textDocument;
QString currentText;
EventRef keydownEvent;
+ QWidget *lastFocusWid;
};
QT_END_NAMESPACE