[gtk/wip/carlosg/imwayland-for-master: 3/12] modules: Check current context before retrieving surrounding



commit 1e69d248cbe424dfd0c6a37b87e53ac5a0234b17
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 7 16:54:13 2018 +0200

    modules: Check current context before retrieving surrounding
    
    There may be situations where this might get called while the
    currently focused context just went away (eg. after setting the
    text widget unsensitive).
    
    Closes: #1317

 gtk/gtkimcontextwayland.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c
index d3286bf7a5..2e5e81f2f3 100644
--- a/gtk/gtkimcontextwayland.c
+++ b/gtk/gtkimcontextwayland.c
@@ -105,6 +105,9 @@ notify_external_change (GtkIMContextWayland *context)
 {
   gboolean result;
 
+  if (!global->current)
+    return;
+
   context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER;
   g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
 }


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