diff options
author | Peng Huang <shawn.p.huang@gmail.com> | 2011-06-17 23:46:31 -0400 |
---|---|---|
committer | Peng Huang <shawn.p.huang@gmail.com> | 2011-06-17 23:46:31 -0400 |
commit | 92b30f09885a91cd74840677aab46159a23192c6 (patch) | |
tree | 18f1b23abbfe83f49c8698a3dc301c57480082e8 /client | |
parent | 1da68ecf2fd4aca41e90715822a9902f4e8162f6 (diff) | |
download | ibus-92b30f09885a91cd74840677aab46159a23192c6.tar.gz |
Restore cursor location when a new IBusInputContext is created.
BUG=http://crosbug.com/16500
TEST=Linux desktop
Review URL: http://codereview.appspot.com/4635044
Diffstat (limited to 'client')
-rw-r--r-- | client/gtk2/ibusimcontext.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index ca5b581f..ec764ef2 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -125,7 +125,7 @@ static void ibus_im_context_set_surrounding /* static methods*/ static void _create_input_context (IBusIMContext *context); static gboolean _set_cursor_location_internal - (GtkIMContext *context); + (IBusIMContext *context); static void _bus_connected_cb (IBusBus *bus, IBusIMContext *context); @@ -762,7 +762,7 @@ ibus_im_context_focus_in (GtkIMContext *context) * it blocks UI. So delay it to idle callback. */ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, (GSourceFunc) _set_cursor_location_internal, - g_object_ref (context), + g_object_ref (ibusimcontext), (GDestroyNotify) g_object_unref); /* retrieve the initial surrounding-text (regardless of whether @@ -881,9 +881,8 @@ ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) } static gboolean -_set_cursor_location_internal (GtkIMContext *context) +_set_cursor_location_internal (IBusIMContext *ibusimcontext) { - IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); GdkRectangle area; if(ibusimcontext->client_window == NULL || @@ -929,7 +928,7 @@ ibus_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area) return; } ibusimcontext->cursor_area = *area; - _set_cursor_location_internal (context); + _set_cursor_location_internal (ibusimcontext); gtk_im_context_set_cursor_location (ibusimcontext->slave, area); } @@ -1433,6 +1432,7 @@ _create_input_context_done (IBusBus *bus, if (ibusimcontext->has_focus) { ibus_input_context_focus_in (ibusimcontext->ibuscontext); + _set_cursor_location_internal (ibusimcontext); } } |