[gtk/wip/Jehan/GtkIMContextWayland: 3/3] modules: focus out the GtkIMContextWayland upon finalization.



commit b592ded80ad4825d115317ba6750a086da0434c0
Author: Jehan <jehan girinstud io>
Date:   Sun Jun 28 16:52:33 2020 +0200

    modules: focus out the GtkIMContextWayland upon finalization.
    
    In particular, it will NULL-ified the current global context if this is
    the finalized one, avoiding dangling invalid pointers.

 modules/input/imwayland.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/modules/input/imwayland.c b/modules/input/imwayland.c
index 12d18a0f64..87c4ae806f 100644
--- a/modules/input/imwayland.c
+++ b/modules/input/imwayland.c
@@ -113,6 +113,8 @@ static const GtkIMContextInfo *info_list[] =
   &imwayland_info,
 };
 
+static void gtk_im_context_wayland_focus_out (GtkIMContext *context);
+
 #define GTK_IM_CONTEXT_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), type_wayland, GtkIMContextWayland))
 
 #ifndef INCLUDE_IM_wayland
@@ -469,6 +471,8 @@ gtk_im_context_wayland_finalize (GObject *object)
 {
   GtkIMContextWayland *context = GTK_IM_CONTEXT_WAYLAND (object);
 
+  gtk_im_context_wayland_focus_out (GTK_IM_CONTEXT (context));
+
   g_clear_object (&context->window);
   g_clear_object (&context->gesture);
   g_free (context->surrounding.text);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]