--- rxvt-unicode/src/rxvtcolor.C 2004/05/30 19:12:42 1.15 +++ rxvt-unicode/src/rxvtcolor.C 2004/07/29 22:34:12 1.17 @@ -104,6 +104,7 @@ ///////////////////////////////////////////////////////////////////////////// +#ifdef USE_XIM static void im_destroy_cb (XIM unused1, XPointer client_data, XPointer unused3) { @@ -128,7 +129,8 @@ ximcallback.client_data = (XPointer)this; ximcallback.callback = im_destroy_cb; - XSetIMValues (xim, XNDestroyCallback, &ximcallback, NULL); + ((void (*)(XIM, ...)) XSetIMValues) + (xim, XNDestroyCallback, &ximcallback, NULL); return true; } @@ -138,6 +140,7 @@ if (xim) XCloseIM (xim); } +#endif ///////////////////////////////////////////////////////////////////////////// @@ -185,7 +188,9 @@ fcntl (fd, F_SETFD, FD_CLOEXEC); XSelectInput (display, root, PropertyChangeMask); +#ifdef USE_XIM xa_xim_servers = XInternAtom (display, "XIM_SERVERS", 0); +#endif flush (); @@ -200,11 +205,13 @@ XCloseDisplay (display); } +#ifdef USE_XIM void rxvt_display::im_change_cb () { for (im_watcher **i = imw.begin (); i != imw.end (); ++i) (*i)->call (); } +#endif void rxvt_display::x_cb (io_watcher &w, short revents) { @@ -215,10 +222,12 @@ //printf ("T %d w %lx\n", xev.type, xev.xany.window);//D +#ifdef USE_XIM if (xev.type == PropertyNotify && xev.xany.window == root && xev.xproperty.atom == xa_xim_servers) im_change_cb (); +#endif for (int i = xw.size (); i--; ) { @@ -258,6 +267,15 @@ xw[w->active - 1] = 0; } +void rxvt_display::set_selection_owner (rxvt_term *owner) +{ + if (selection_owner && selection_owner != owner) + selection_owner->selection_clear (); + + selection_owner = owner; +} + +#ifdef USE_XIM void rxvt_display::reg (im_watcher *w) { imw.push_back (w); @@ -268,14 +286,6 @@ imw.erase (find (imw.begin (), imw.end (), w)); } -void rxvt_display::set_selection_owner (rxvt_term *owner) -{ - if (selection_owner && selection_owner != owner) - selection_owner->selection_clear (); - - selection_owner = owner; -} - rxvt_xim *rxvt_display::get_xim (const char *locale, const char *modifiers) { char *id; @@ -301,6 +311,7 @@ { xims.put (xim); } +#endif Atom rxvt_display::atom (const char *name) {