StEntry: add a hook to set the cursor from libgnome-shell

We need to call into MetaScreen to set the cursor, but we can't
do that from libst, so add a hook that libgnome-shell can fill,
and remove more ClutterX11 usage.

https://bugzilla.gnome.org/show_bug.cgi?id=707467
This commit is contained in:
Giovanni Campagna
2013-09-11 18:11:55 +02:00
parent ba9c1d98f6
commit 8ae0f1a9dc
3 changed files with 33 additions and 27 deletions

View File

@ -828,6 +828,16 @@ gnome_shell_gdk_event_handler (GdkEvent *event_gdk,
gtk_main_do_event (event_gdk);
}
static void
entry_cursor_func (StEntry *entry,
gboolean use_ibeam,
gpointer user_data)
{
ShellGlobal *global = user_data;
meta_screen_set_cursor (global->meta_screen, use_ibeam ? META_CURSOR_IBEAM : META_CURSOR_DEFAULT);
}
void
_shell_global_set_plugin (ShellGlobal *global,
MetaPlugin *plugin)
@ -878,6 +888,7 @@ _shell_global_set_plugin (ShellGlobal *global,
}
st_im_text_set_event_window (global->ibus_window);
st_entry_set_cursor_func (entry_cursor_func, global);
g_signal_connect (global->stage, "notify::width",
G_CALLBACK (global_stage_notify_width), global);