From 93e9b2dde96ba2587b1ba836e6c7fde144aa9461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Tue, 16 Jul 2019 13:32:58 +0200 Subject: [PATCH] ServerContextService: Hide the widget instead of destroying it This is quicker and makes sure we don't stack up surfaces. --- src/server-context-service.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/server-context-service.c b/src/server-context-service.c index dd986da6..c0dfaff5 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -254,7 +254,8 @@ server_context_service_real_show_keyboard (EekboardContextService *_context) { ServerContextService *context = SERVER_CONTEXT_SERVICE(_context); - make_window (context); + if (!context->window) + make_window (context); update_widget (context); EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)-> @@ -270,8 +271,6 @@ server_context_service_real_hide_keyboard (EekboardContextService *_context) gtk_widget_hide (context->window); g_clear_pointer (&context->widget, gtk_widget_destroy); - destroy_window (context); - EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)-> hide_keyboard (_context); } @@ -315,7 +314,7 @@ server_context_service_dispose (GObject *object) { ServerContextService *context = SERVER_CONTEXT_SERVICE(object); - g_clear_pointer (&context->window, gtk_widget_destroy); + destroy_window (context); context->widget = NULL; G_OBJECT_CLASS (server_context_service_parent_class)->dispose (object);