Subject: bug#74590: 31.0.50 [scratch/igc branch]; key input sometimes skip fcitx input method preedit box

From: Pip Cet <[email-masked]>
Date: Sun, 01 Dec 2024 10:08:04 +0000

Gerd Möllmann <[email-masked]> writes:

> It probably isn't relevant because of this
>
>   #ifdef HAVE_MPS
>   void free_glib_user_data (gpointer data, GClosure *closure)
>   {
>     igc_xfree (data);
>   }
>   #else
>   void free_glib_user_data (gpointer data, GClosure *closure)
>   {
>     return;
>   }
>   #endif
>
> Don't know where the allocation takes place.

It's this code in gtkutil.h:

#ifdef HAVE_MPS
INLINE gpointer
glib_user_data (void *o)
{
  gpointer p = igc_xzalloc_ambig (sizeof (o));
  memcpy (p, &o, sizeof (o));
  return p;
}

INLINE void *
get_glib_user_data (gpointer p)
{
  return *(void **)p;
}
#else
INLINE gpointer
glib_user_data (void *o)
{
  return (gpointer)o;
}

INLINE void *
get_glib_user_data (gpointer p)
{
  return (void *)p;
}
#endif

Does that look correct to you?

My understanding is that the GTK input method code is only used if
x_gtk_use_native_input is true (which we'll have to wait for the OP to
confirm or deny), but xg_create_frame_widgets always calls
gtk_im_multicontext_new, so the problem might be in the GTK code...

Pip