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

From: Yikai Zhao <[email-masked]>
Date: Mon, 2 Dec 2024 16:58:01 +0800

On Sun, Dec 1, 2024 at 6:08 PM Pip Cet <[email-masked]> wrote:
>
> 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),

`x-gtk-use-native-input` is nil here, if that's what you are asking.

> but xg_create_frame_widgets always calls
> gtk_im_multicontext_new, so the problem might be in the GTK code...
>
> Pip
>