mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-31 02:32:49 -05:00
GTK: tell the input method context about focus changes
GtkIMContext has focus_in and focus_out methods for telling it when the corresponding widget gains or loses keyboard focus. It's not obvious to me why these are necessary, but PuTTY now calls them when it sees focus-in and focus-out events for the terminal window. Somehow, this has caused Hangul input to start working in PuTTY. I can't yet see what I'm typing for lack of proper preedit support, though.
This commit is contained in:
parent
c229a5e177
commit
e98071dd38
@ -2518,6 +2518,12 @@ void destroy(GtkWidget *widget, gpointer data)
|
||||
gint focus_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
|
||||
{
|
||||
GtkFrontend *inst = (GtkFrontend *)data;
|
||||
#if GTK_CHECK_VERSION(2,0,0)
|
||||
if (event->in)
|
||||
gtk_im_context_focus_in(inst->imc);
|
||||
else
|
||||
gtk_im_context_focus_out(inst->imc);
|
||||
#endif
|
||||
term_set_focus(inst->term, event->in);
|
||||
term_update(inst->term);
|
||||
show_mouseptr(inst, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user