Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1454 by [email protected]: Assertion in gtk+ IM module
http://code.google.com/p/ibus/issues/detail?id=1454

Currently gtk+ doesn't immediately switch the IM module when the XSETTING gtk-im-module changes. To fix that I'm proposing the attached patch to be pushed into gtk+ upstream.

This patch introduces a problem with the default configuration of the IBus gtk+ IM module. An assertion is hit out of the _key_snooper_cb() function. In general it's not a good idea to use gtk+ key snoopers and the IBus module seems to otherwise work all right if I set the env var IBUS_DISABLE_SNOOPER. IMO you should just stop using the key snooper but that's not up to me to decide so I'm reporting here so that you can decide on the better fix.

Here's the assertion:

#0  0x0000003967e36285 in raise () from /lib64/libc.so.6
#1  0x0000003967e37b9b in abort () from /lib64/libc.so.6
#2 0x000000325c667f3d in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>, func=0x7f12f71a6cc0 "ibus_input_context_process_key_event_async", message= 0x27d2b70 "assertion failed: (IBUS_IS_INPUT_CONTEXT (context))") at gtestutils.c:1861 #3 0x000000325c668462 in g_assertion_message_expr (domain=0x7f12f71a6558 "IBUS", file= 0x7f12f71a6545 "ibusinputcontext.c", line=863, func=0x7f12f71a6cc0 "ibus_input_context_process_key_event_async",
    expr=<optimized out>) at gtestutils.c:1872
#4 0x00007f12f718c817 in ibus_input_context_process_key_event_async (context=0x25e94a0, keyval=1729, keycode=33, state=0, timeout_msec=-1, cancellable=0x0, callback=0x7f12f73c9dbe <_process_key_event_done>, user_data=
    0x253fe90) at ibusinputcontext.c:863
#5 0x00007f12f73ca226 in _key_snooper_cb (widget=0x22e5490 [GtkWindow], event=0x26c5b60, user_data=0x0)
    at ibusimcontext.c:393
#6 0x00007f12ff82397c in gtk_invoke_key_snoopers (grab_widget=0x22e5490 [GtkWindow], event=0x26c5b60)
    at gtkmain.c:2249
#7 0x00007f12ff8227ed in gtk_main_do_event (event=0x26c5b60) at gtkmain.c:1665 #8 0x00007f12ff3aa886 in _gdk_event_emit (event=0x26c5b60) at gdkevents.c:69 #9 0x00007f12ff3de4a0 in gdk_event_source_dispatch (source=0x22d31f0, callback=0, user_data=0x0)
    at gdkeventsource.c:358
#10 0x000000325c647d7a in g_main_dispatch (context=0x22f3f40) at gmain.c:2515
#11 g_main_context_dispatch (context=0x22f3f40) at gmain.c:3052
#12 0x000000325c648140 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x22f3f40,
    self=<optimized out>) at gmain.c:3123
#13 g_main_context_iterate (context=0x22f3f40, block=<optimized out>, dispatch=1, self=<optimized out>)
    at gmain.c:3060
#14 0x000000325c648545 in g_main_loop_run (loop=0x2491de0) at gmain.c:3317
#15 0x00007f12ff821fb2 in gtk_main () at gtkmain.c:1161
#16 0x0000000000428e58 in main (argc=1, argv=0x7fff7e8b20e8) at main.c:1005
(gdb) f 4
#4 0x00007f12f718c817 in ibus_input_context_process_key_event_async (context=0x25e94a0, keyval=1729, keycode=33, state=0, timeout_msec=-1, cancellable=0x0, callback=0x7f12f73c9dbe <_process_key_event_done>, user_data=
    0x253fe90) at ibusinputcontext.c:863
863         g_assert (IBUS_IS_INPUT_CONTEXT (context));
(gdb) list
858 gint timeout_msec, 859 GCancellable *cancellable, 860 GAsyncReadyCallback callback, 861 gpointer user_data)
862     {
863         g_assert (IBUS_IS_INPUT_CONTEXT (context));
864     
865         g_dbus_proxy_call ((GDBusProxy *) context,
866 "ProcessKeyEvent", /* method_name */
867                            g_variant_new ("(uuu)",




Attachments:
        gtk_im_multicontext_fix.patch  2.3 KB

--
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en

回复