summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-09-07 16:54:13 +0200
committerCarlos Garnacho <carlosg@gnome.org>2018-09-07 17:01:12 +0200
commit88dc784256289820fac148fc5c23d0ad92419881 (patch)
tree0da8df431a54fbb5c5d7413b0b31a02b644cbd26
parent2e9439b017186e2784a49e9396c34c0f40fa88ff (diff)
downloadgtk+-88dc784256289820fac148fc5c23d0ad92419881.tar.gz
modules: Check current context before retrieving surroundingwip/carlosg/issue-1317
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
-rw-r--r--modules/input/imwayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/input/imwayland.c b/modules/input/imwayland.c
index 3589c4c130..32d3c4fb0e 100644
--- a/modules/input/imwayland.c
+++ b/modules/input/imwayland.c
@@ -121,6 +121,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);
}