diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index 16336818..dce47228 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -569,7 +569,9 @@ eekboard_context_service_show_keyboard (EekboardContextService *context) { g_return_if_fail (EEKBOARD_IS_CONTEXT_SERVICE(context)); - EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context)->show_keyboard (context); + if (!context->priv->visible) { + EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context)->show_keyboard (context); + } } void @@ -577,7 +579,9 @@ eekboard_context_service_hide_keyboard (EekboardContextService *context) { g_return_if_fail (EEKBOARD_IS_CONTEXT_SERVICE(context)); - EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context)->hide_keyboard (context); + if (context->priv->visible) { + EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context)->hide_keyboard (context); + } } /** diff --git a/src/server-context-service.c b/src/server-context-service.c index a5629e9b..2ebc8dc0 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -375,6 +375,7 @@ server_context_service_real_hide_keyboard (EekboardContextService *_context) gtk_widget_hide (context->window); gtk_container_remove(GTK_CONTAINER(context->window), context->widget); + context->widget = NULL; // When GTK removes the widget, it doesn't just unlink it, but also frees it destroy_window (context); EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)->