Fix cursor pos problem
authorHuang Peng <shawn.p.huang@gmail.com>
Mon, 18 Aug 2008 02:12:27 +0000 (10:12 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Mon, 18 Aug 2008 02:12:27 +0000 (10:12 +0800)
client/qt4/ibus-input-context.cpp
client/qt4/ibus-input-context.h

index 99d0cf05924fc71cc52a00ed27b7c5cb844caea3..36d610574ab7e94a28c40193126b7754b49ed5a2 100644 (file)
@@ -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 ();
index 2e20bb8cb3fa1705245df97db9d76d4a88285bf9..2fd3e5691e9a8153f860ffbdb153b8361366b2a3 100644 (file)
@@ -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_