Patch for compiling without -DUSE_XIM



Don't know if this has been reported before (I can't remember seeing it
on any list).

GTK+-1.1.9 worked fine until I downloaded gFTP 0.2 and tried to run it. I
got an immediate SEGV in XRegisterIMInstantiateCallback [ invoked from
gdk_im_open(), invoked from gdk_init() ].

Checked in INSTALL and, since I'm running Solaris 2.6, which is (at least
partially, I think) X11R5-based, decided to re-configure with --disable-xim
.... configured OK but wouldn't compile (gdk_use_mb undefined).

Fixed that, also had to create a cut-down gdk_set_locale() for the
"#else /* !USE_XIM */" bit.

Patch appended FYI. This patch doesn't change anything if USE_XIM is
defined (the default), only if it's undefined (e.g. for older
implementations of X).

Allan

*** gtk+-1.1.9/gdk/gdkim.c.orig	Thu Dec 17 04:37:09 1998
--- gtk+-1.1.9/gdk/gdkim.c	Wed Dec 30 14:48:23 1998
***************
*** 1357,1362 ****
--- 1357,1368 ----
  
  #else /* !USE_XIM */
  
+ gchar*
+ gdk_set_locale (void)
+ {
+   return setlocale (LC_ALL,NULL);
+ }
+ 
  void 
  gdk_im_begin (GdkIC *ic, GdkWindow* window)
  {
***************
*** 1445,1450 ****
--- 1451,1457 ----
  {
    gchar *mbstr;
  
+ #ifdef USE_XIM
    if (gdk_use_mb)
      {
        XTextProperty tpr;
***************
*** 1481,1486 ****
--- 1488,1494 ----
        XFree (tpr.value);
      }
    else
+ #endif
      {
        gint length = 0;
        gint i;
***************
*** 1507,1512 ****
--- 1515,1521 ----
  gint
  gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
  {
+ #ifdef USE_XIM
    if (gdk_use_mb)
      {
        XTextProperty tpr;
***************
*** 1535,1540 ****
--- 1544,1550 ----
        return len_cpy;
      }
    else
+ #endif
      {
        gint i;
  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]