GNOME Bugzilla – Bug 567124
proposal to delay doing something related to immodule until widgets realized
Last modified: 2009-11-12 21:25:17 UTC
For technical reason to obtain an immodule configuration through xsettings, gtk+ relies on the client window now. however there are the case where immodule instance is created before the client window is set. i.e. before "realize" method is invoked. once it's created, it won't be updated unless any changes is notified. this makes a trouble that the unexpected immodule is working on applications. I'd suggest that would be better delaying any operations related to IM until widgets is realized.
Created attachment 126085 [details] [review] proposed patch
Looks like a good idea to me.
* gtk/gtktextview.c: Don't set up im stuff if the widget is not realized. * gtk/gtkimmodule.c: Assert that we have a window.
After the last change to gtkimmulticontext.c on 2009-01-24, gtk-demo has started beeping once when it starts and once when it exits... Here is the top (bottom?) of a backtrace on X11 from the beep at start:
+ Trace 211986
Matthias, sorry, I should check this carefully earlier, but your fix in r22214 didn't fixes the original issue I've described at the top of comments. because global_context_id held the unexpected value so that gtk_im_multicontext_get_slave() is invoked prior to gtk_im_multicontext_set_client_window(). so even if slave instance is reset when _set_client_window() is called, _get_slave() doesn't try to evaluate a context id through _gtk_im_module_get_default_context_id() that possibly may returns new id.
Any comments or thoughts?
No, I haven't looked at this yet, sorry.
Please try again with this change (will be in 2.17.11). It might fix your problem. commit 1c0ecc0380f8e30df297c5f1156c11ce70c98c81 Author: Matthias Clasen <mclasen@redhat.com> Date: Fri Sep 4 18:09:44 2009 -0400 Rework the way IM contexts are set Add a function to obtain the effective context id, and reset the slave only when the effective context id is different from the current context id, when setting a client window and on focus in. This might fix bug 593868 and bug 567124.
I just tried 2.17.11 in fedora rawhide and with this I guess chromium now picks up imsettings correctly.
Looks good now. thanks!
Ok, marking as fixed then :)