Revision: 6350
Author: nogu.dev
Date: Wed Apr 28 18:24:31 2010
Log: * qt4/immodule/candidatewindow.cpp
  - Fix position of candidate window on window move.
http://code.google.com/p/uim/source/detail?r=6350

Modified:
 /trunk/qt4/immodule/candidatewindow.cpp

=======================================
--- /trunk/qt4/immodule/candidatewindow.cpp     Wed Apr 28 15:51:18 2010
+++ /trunk/qt4/immodule/candidatewindow.cpp     Wed Apr 28 18:24:31 2010
@@ -602,7 +602,15 @@
     if ( obj == window ) {
         if ( event->type() == QEvent::Move ) {
             QMoveEvent *moveEvent = static_cast<QMoveEvent *>( event );
-            move( pos() + moveEvent->pos() - moveEvent->oldPos() );
+            QWidget *widget = QApplication::focusWidget();
+            if ( widget ) {
+                QRect rect
+ = widget->inputMethodQuery( Qt::ImMicroFocus ).toRect();
+                QPoint p = widget->mapToGlobal( rect.topLeft() );
+                layoutWindow( p.x(), p.y(), rect.width(), rect.height() );
+            } else {
+                move( pos() + moveEvent->pos() - moveEvent->oldPos() );
+            }
         }
         return false;
     }

Reply via email to