Merge branch 'idle' into 'master'

visibility: Stop calling GTK functions from the visibility manager

See merge request Librem5/squeekboard!425
This commit is contained in:
Alexander Mikhaylenko
2021-01-10 11:47:51 +00:00

View File

@ -239,6 +239,13 @@ server_context_service_real_show_keyboard (ServerContextService *self)
gtk_widget_show (GTK_WIDGET(self->window));
}
static gboolean
show_keyboard_source_func(ServerContextService *context)
{
server_context_service_real_show_keyboard(context);
return G_SOURCE_REMOVE;
}
static void
server_context_service_real_hide_keyboard (ServerContextService *self)
{
@ -246,6 +253,13 @@ server_context_service_real_hide_keyboard (ServerContextService *self)
self->visible = FALSE;
}
static gboolean
hide_keyboard_source_func(ServerContextService *context)
{
server_context_service_real_hide_keyboard(context);
return G_SOURCE_REMOVE;
}
static gboolean
on_hide (ServerContextService *self)
{
@ -266,7 +280,7 @@ server_context_service_show_keyboard (ServerContextService *self)
}
if (!self->visible) {
server_context_service_real_show_keyboard (self);
g_idle_add((GSourceFunc)show_keyboard_source_func, self);
}
}
@ -289,7 +303,7 @@ server_context_service_hide_keyboard (ServerContextService *self)
g_return_if_fail (SERVER_IS_CONTEXT_SERVICE(self));
if (self->visible) {
server_context_service_real_hide_keyboard (self);
g_idle_add((GSourceFunc)hide_keyboard_source_func, self);
}
}