Commit bbfb15a5 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

imm32: Update the IME composition window position after drawing.

parent 354a8bb1
...@@ -186,7 +186,7 @@ static UINT ime_set_composition_status( HIMC himc, BOOL composition ) ...@@ -186,7 +186,7 @@ static UINT ime_set_composition_status( HIMC himc, BOOL composition )
static void ime_ui_paint( HIMC himc, HWND hwnd ) static void ime_ui_paint( HIMC himc, HWND hwnd )
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
RECT rect; RECT rect, new_rect;
HDC hdc; HDC hdc;
HMONITOR monitor; HMONITOR monitor;
MONITORINFO mon_info; MONITORINFO mon_info;
...@@ -201,6 +201,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) ...@@ -201,6 +201,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd )
GetClientRect( hwnd, &rect ); GetClientRect( hwnd, &rect );
FillRect( hdc, &rect, (HBRUSH)(COLOR_WINDOW + 1) ); FillRect( hdc, &rect, (HBRUSH)(COLOR_WINDOW + 1) );
new_rect = rect;
if ((str = input_context_get_comp_str( ctx, FALSE, &len ))) if ((str = input_context_get_comp_str( ctx, FALSE, &len )))
{ {
...@@ -233,6 +234,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) ...@@ -233,6 +234,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd )
rect.top = cpt.y; rect.top = cpt.y;
rect.right = rect.left + pt.x; rect.right = rect.left + pt.x;
rect.bottom = rect.top + pt.y; rect.bottom = rect.top + pt.y;
offset.x = offset.y = 0;
monitor = MonitorFromPoint( cpt, MONITOR_DEFAULTTOPRIMARY ); monitor = MonitorFromPoint( cpt, MONITOR_DEFAULTTOPRIMARY );
} }
else /* CFS_DEFAULT */ else /* CFS_DEFAULT */
...@@ -283,8 +285,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) ...@@ -283,8 +285,7 @@ static void ime_ui_paint( HIMC himc, HWND hwnd )
} }
} }
SetWindowPos( hwnd, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, new_rect = rect;
rect.bottom - rect.top, SWP_NOACTIVATE );
TextOutW( hdc, offset.x, offset.y, str, len ); TextOutW( hdc, offset.x, offset.y, str, len );
if (font) SelectObject( hdc, font ); if (font) SelectObject( hdc, font );
...@@ -293,6 +294,10 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) ...@@ -293,6 +294,10 @@ static void ime_ui_paint( HIMC himc, HWND hwnd )
EndPaint( hwnd, &ps ); EndPaint( hwnd, &ps );
ImmUnlockIMC( himc ); ImmUnlockIMC( himc );
if (!EqualRect( &rect, &new_rect ))
SetWindowPos( hwnd, HWND_TOPMOST, new_rect.left, new_rect.top, new_rect.right - new_rect.left,
new_rect.bottom - new_rect.top, SWP_NOACTIVATE );
} }
static void ime_ui_update_window( INPUTCONTEXT *ctx, HWND hwnd ) static void ime_ui_update_window( INPUTCONTEXT *ctx, HWND hwnd )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment