Is there any reason not making the text entry focused before sending KeyPress event to it?

Yichao Yu yyc1992 at
Mon Jul 16 00:06:41 EDT 2012

Hi All,

When pressing a key in pidgin's chat window, the key will be sent to
the input entry even if it is not focused. However, this event is not
sent to input method (which is REALLY annoy for ppl like me that uses
input method!!!)

Looking at the source code, in pidgin/gtkconv.c (arround line 2271)

	if (event->type == GDK_KEY_RELEASE)

	gtk_widget_event(gtkconv->entry, (GdkEvent *)event);
which means the entry will not be focused when a keypress event is
sent and this causes the imcontext not sending the event to input
method. Since the event will anyway be sent to the entry, I cannot see
the point why it should not be focused. Is there really any specific
reason for doing that?

(btw, afaik, removing the if line fixes the input method issue perfectly)

Yichao Yu

More information about the Devel mailing list