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

winex11: Use ime_comp_buf != NULL instead of ximInComposeMode.

parent 2d4742aa
...@@ -49,8 +49,6 @@ ...@@ -49,8 +49,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(event); WINE_DEFAULT_DEBUG_CHANNEL(event);
WINE_DECLARE_DEBUG_CHANNEL(xdnd); WINE_DECLARE_DEBUG_CHANNEL(xdnd);
extern BOOL ximInComposeMode;
#define DndNotDnd -1 /* OffiX drag&drop */ #define DndNotDnd -1 /* OffiX drag&drop */
#define DndUnknown 0 #define DndUnknown 0
#define DndRawData 1 #define DndRawData 1
...@@ -810,7 +808,7 @@ static void focus_out( Display *display , HWND hwnd ) ...@@ -810,7 +808,7 @@ static void focus_out( Display *display , HWND hwnd )
int revert; int revert;
XIC xic; XIC xic;
if (ximInComposeMode) return; if (xim_in_compose_mode()) return;
x11drv_thread_data()->last_focus = hwnd; x11drv_thread_data()->last_focus = hwnd;
if ((xic = X11DRV_get_ic( hwnd ))) XUnsetICFocus( xic ); if ((xic = X11DRV_get_ic( hwnd ))) XUnsetICFocus( xic );
......
...@@ -436,7 +436,6 @@ extern BOOL keyboard_grabbed DECLSPEC_HIDDEN; ...@@ -436,7 +436,6 @@ extern BOOL keyboard_grabbed DECLSPEC_HIDDEN;
extern unsigned int screen_bpp DECLSPEC_HIDDEN; extern unsigned int screen_bpp DECLSPEC_HIDDEN;
extern BOOL usexrandr DECLSPEC_HIDDEN; extern BOOL usexrandr DECLSPEC_HIDDEN;
extern BOOL usexvidmode DECLSPEC_HIDDEN; extern BOOL usexvidmode DECLSPEC_HIDDEN;
extern BOOL ximInComposeMode DECLSPEC_HIDDEN;
extern BOOL use_take_focus DECLSPEC_HIDDEN; extern BOOL use_take_focus DECLSPEC_HIDDEN;
extern BOOL use_primary_selection DECLSPEC_HIDDEN; extern BOOL use_primary_selection DECLSPEC_HIDDEN;
extern BOOL use_system_cursors DECLSPEC_HIDDEN; extern BOOL use_system_cursors DECLSPEC_HIDDEN;
...@@ -824,6 +823,7 @@ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN; ...@@ -824,6 +823,7 @@ extern struct x11drv_display_device_handler desktop_handler DECLSPEC_HIDDEN;
/* XIM support */ /* XIM support */
extern BOOL xim_init( const WCHAR *input_style ) DECLSPEC_HIDDEN; extern BOOL xim_init( const WCHAR *input_style ) DECLSPEC_HIDDEN;
extern void xim_thread_attach( struct x11drv_thread_data *data ) DECLSPEC_HIDDEN; extern void xim_thread_attach( struct x11drv_thread_data *data ) DECLSPEC_HIDDEN;
extern BOOL xim_in_compose_mode(void) DECLSPEC_HIDDEN;
extern void X11DRV_XIMLookupChars( const char *str, UINT count ) DECLSPEC_HIDDEN; extern void X11DRV_XIMLookupChars( const char *str, UINT count ) DECLSPEC_HIDDEN;
extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN; extern XIC X11DRV_get_ic( HWND hwnd ) DECLSPEC_HIDDEN;
......
...@@ -42,8 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(xim); ...@@ -42,8 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(xim);
#define XICProc XIMProc #define XICProc XIMProc
#endif #endif
BOOL ximInComposeMode=FALSE;
static WCHAR *ime_comp_buf; static WCHAR *ime_comp_buf;
static XIMStyle input_style = 0; static XIMStyle input_style = 0;
...@@ -69,6 +67,11 @@ static const char *debugstr_xim_style( XIMStyle style ) ...@@ -69,6 +67,11 @@ static const char *debugstr_xim_style( XIMStyle style )
return wine_dbg_sprintf( "%s", buffer ); return wine_dbg_sprintf( "%s", buffer );
} }
BOOL xim_in_compose_mode(void)
{
return !!ime_comp_buf;
}
static void xim_update_comp_string( UINT offset, UINT old_len, const WCHAR *text, UINT new_len ) static void xim_update_comp_string( UINT offset, UINT old_len, const WCHAR *text, UINT new_len )
{ {
UINT len = ime_comp_buf ? wcslen( ime_comp_buf ) : 0; UINT len = ime_comp_buf ? wcslen( ime_comp_buf ) : 0;
...@@ -138,7 +141,9 @@ static int xic_preedit_start( XIC xic, XPointer user, XPointer arg ) ...@@ -138,7 +141,9 @@ static int xic_preedit_start( XIC xic, XPointer user, XPointer arg )
TRACE( "xic %p, hwnd %p, arg %p\n", xic, hwnd, arg ); TRACE( "xic %p, hwnd %p, arg %p\n", xic, hwnd, arg );
x11drv_client_call( client_ime_set_composition_status, TRUE ); x11drv_client_call( client_ime_set_composition_status, TRUE );
ximInComposeMode = TRUE; if ((ime_comp_buf = realloc( ime_comp_buf, sizeof(WCHAR) ))) *ime_comp_buf = 0;
else ERR( "Failed to allocate preedit buffer\n" );
return -1; return -1;
} }
...@@ -148,7 +153,6 @@ static int xic_preedit_done( XIC xic, XPointer user, XPointer arg ) ...@@ -148,7 +153,6 @@ static int xic_preedit_done( XIC xic, XPointer user, XPointer arg )
TRACE( "xic %p, hwnd %p, arg %p\n", xic, hwnd, arg ); TRACE( "xic %p, hwnd %p, arg %p\n", xic, hwnd, arg );
ximInComposeMode = FALSE;
free( ime_comp_buf ); free( ime_comp_buf );
ime_comp_buf = NULL; ime_comp_buf = NULL;
......
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