# HG changeset patch # User Dave Love # Date 1053555135 0 # Node ID 0e2a60d0ca7bb6a66c3c543fcb2f7ed9b2ae2000 # Parent e9be5c94117e88517d0c165fb04cbe916f6f4c85 (x_window, x_window): Use use_xim. diff -r e9be5c94117e -r 0e2a60d0ca7b src/xfns.c --- a/src/xfns.c Wed May 21 22:11:50 2003 +0000 +++ b/src/xfns.c Wed May 21 22:12:15 2003 +0000 @@ -2120,7 +2120,7 @@ static XIMStyle best_xim_style P_ ((XIMStyles *, XIMStyles *)); -/* Supported XIM styles, ordered by preferenc. */ +/* Supported XIM styles, ordered by preference. */ static XIMStyle supported_xim_styles[] = { @@ -2578,9 +2578,8 @@ #ifdef HAVE_X_I18N FRAME_XIC (f) = NULL; -#ifdef USE_XIM - create_frame_xic (f); -#endif + if (use_xim) + create_frame_xic (f); #endif f->output_data.x->wm_hints.input = True; @@ -2657,31 +2656,32 @@ #ifdef HAVE_X_I18N FRAME_XIC (f) = NULL; -#ifdef USE_XIM - BLOCK_INPUT; - create_frame_xic (f); - if (FRAME_XIC (f)) - { - /* XIM server might require some X events. */ - unsigned long fevent = NoEventMask; - XGetICValues(FRAME_XIC (f), XNFilterEvents, &fevent, NULL); - - if (fevent != NoEventMask) - { - XSetWindowAttributes attributes; - XWindowAttributes wattr; - unsigned long attribute_mask; - - XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - &wattr); - attributes.event_mask = wattr.your_event_mask | fevent; - attribute_mask = CWEventMask; - XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - attribute_mask, &attributes); - } - } - UNBLOCK_INPUT; -#endif +if (use_xim) + { + BLOCK_INPUT; + create_frame_xic (f); + if (FRAME_XIC (f)) + { + /* XIM server might require some X events. */ + unsigned long fevent = NoEventMask; + XGetICValues(FRAME_XIC (f), XNFilterEvents, &fevent, NULL); + + if (fevent != NoEventMask) + { + XSetWindowAttributes attributes; + XWindowAttributes wattr; + unsigned long attribute_mask; + + XGetWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + &wattr); + attributes.event_mask = wattr.your_event_mask | fevent; + attribute_mask = CWEventMask; + XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + attribute_mask, &attributes); + } + } + UNBLOCK_INPUT; + } #endif } @@ -2721,19 +2721,20 @@ attribute_mask, &attributes); #ifdef HAVE_X_I18N -#ifdef USE_XIM - create_frame_xic (f); - if (FRAME_XIC (f)) - { - /* XIM server might require some X events. */ - unsigned long fevent = NoEventMask; - XGetICValues(FRAME_XIC (f), XNFilterEvents, &fevent, NULL); - attributes.event_mask |= fevent; - attribute_mask = CWEventMask; - XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - attribute_mask, &attributes); - } -#endif + if use_xim + { + create_frame_xic (f); + if (FRAME_XIC (f)) + { + /* XIM server might require some X events. */ + unsigned long fevent = NoEventMask; + XGetICValues(FRAME_XIC (f), XNFilterEvents, &fevent, NULL); + attributes.event_mask |= fevent; + attribute_mask = CWEventMask; + XChangeWindowAttributes (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + attribute_mask, &attributes); + } + } #endif /* HAVE_X_I18N */ validate_x_resource_name ();