ServerContextService: Hide the widget instead of destroying it

This is quicker and makes sure we don't stack up surfaces.
This commit is contained in:
Guido Günther
2019-07-16 13:32:58 +02:00
parent c3a54595ea
commit 93e9b2dde9

View File

@ -254,6 +254,7 @@ server_context_service_real_show_keyboard (EekboardContextService *_context)
{ {
ServerContextService *context = SERVER_CONTEXT_SERVICE(_context); ServerContextService *context = SERVER_CONTEXT_SERVICE(_context);
if (!context->window)
make_window (context); make_window (context);
update_widget (context); update_widget (context);
@ -270,8 +271,6 @@ server_context_service_real_hide_keyboard (EekboardContextService *_context)
gtk_widget_hide (context->window); gtk_widget_hide (context->window);
g_clear_pointer (&context->widget, gtk_widget_destroy); g_clear_pointer (&context->widget, gtk_widget_destroy);
destroy_window (context);
EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)-> EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)->
hide_keyboard (_context); hide_keyboard (_context);
} }
@ -315,7 +314,7 @@ server_context_service_dispose (GObject *object)
{ {
ServerContextService *context = SERVER_CONTEXT_SERVICE(object); ServerContextService *context = SERVER_CONTEXT_SERVICE(object);
g_clear_pointer (&context->window, gtk_widget_destroy); destroy_window (context);
context->widget = NULL; context->widget = NULL;
G_OBJECT_CLASS (server_context_service_parent_class)->dispose (object); G_OBJECT_CLASS (server_context_service_parent_class)->dispose (object);