diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-18 10:12:27 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-18 10:12:27 +0800 |
commit | db0290859be1708a2d78636820eb52f2c3bfbe67 (patch) | |
tree | 26e105596196fccdbf220cca13a1bc8b57957087 /client | |
parent | f1390a784766ccfc5903d54e9ae03553dac5273f (diff) | |
download | ibus-db0290859be1708a2d78636820eb52f2c3bfbe67.tar.gz ibus-db0290859be1708a2d78636820eb52f2c3bfbe67.tar.xz ibus-db0290859be1708a2d78636820eb52f2c3bfbe67.zip |
Fix cursor pos problem
Diffstat (limited to 'client')
-rw-r--r-- | client/qt4/ibus-input-context.cpp | 9 | ||||
-rw-r--r-- | client/qt4/ibus-input-context.h | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/client/qt4/ibus-input-context.cpp b/client/qt4/ibus-input-context.cpp index 99d0cf0..36d6105 100644 --- a/client/qt4/ibus-input-context.cpp +++ b/client/qt4/ibus-input-context.cpp @@ -105,10 +105,8 @@ IBusInputContext::update () QPoint topleft = widget->mapToGlobal(QPoint(0,0)); rect.translate (topleft); - if (cursor_location != rect ) { - client->setCursorLocation (this, rect); - cursor_location = rect; - } + + client->setCursorLocation (this, rect); #if 0 QVariant value; @@ -135,15 +133,18 @@ void IBusInputContext::setFocusWidget (QWidget *widget) { QInputContext::setFocusWidget (widget); + if (widget == NULL) { has_focus = false; client->focusOut (this); } else { + /* KateView can not support preedit well. */ if (widget->inherits("KateViewInternal")) client->setCapabilities (this, 0); else client->setCapabilities (this, 1); + has_focus = true; client->focusIn (this); update (); diff --git a/client/qt4/ibus-input-context.h b/client/qt4/ibus-input-context.h index 2e20bb8..2fd3e56 100644 --- a/client/qt4/ibus-input-context.h +++ b/client/qt4/ibus-input-context.h @@ -64,7 +64,6 @@ private: int preedit_cursor_pos; bool has_focus; QList <QList <quint32> > preedit_attrs; - QRect cursor_location; }; #endif //__IBUS_INPUT_CONTEXT_H_ |