diff options
authorChris Michael <cp.michael@samsung.com>2018-08-14 15:45:30 +0100
committerAlastair Poole <netstar@gmail.com>2018-08-14 15:45:57 +0100
commit6119cc0c65f0a8e1de6e330892f61d95e1b7bd50 (patch)
parentedje: unset internal _need_imf flag on shutdown (diff)
elementary: Check for valid cursor_rect when (un)setting focus
Summary: As the cursor_rect for elm_code_widget is not created until the code widget gets focus, we cannot just assume it is already there when trying to emit a focus signal. The cursor_rect does not get created until widget_cursor_update is called. This fixes an issue where NULL is passed to efl_layout_signal_emit. To test this, just launch elementary_test and click the Code Editor test. As soon as you try to click into the Code Editor, this gets triggered. ref https://phab.enlightenment.org/T7030 Reviewers: netstar, ajwillia.ms Reviewed By: netstar Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl Maniphest Tasks: https://phab.enlightenment.org/T7030 Differential Revision: https://phab.enlightenment.org/D6701
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index f9798458a3..f78a78daa8 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -1833,7 +1833,8 @@ _elm_code_widget_focused_event_cb(void *data, Evas_Object *obj,
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
pd->focussed = EINA_TRUE;
- elm_layout_signal_emit(pd->cursor_rect, "elm,action,focus", "elm");
+ if (pd->cursor_rect)
+ elm_layout_signal_emit(pd->cursor_rect, "elm,action,focus", "elm");
_elm_code_widget_refresh(obj, NULL);
@@ -1849,7 +1850,8 @@ _elm_code_widget_unfocused_event_cb(void *data, Evas_Object *obj,
pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
pd->focussed = EINA_FALSE;
- elm_layout_signal_emit(pd->cursor_rect, "elm,action,unfocus", "elm");
+ if (pd->cursor_rect)
+ elm_layout_signal_emit(pd->cursor_rect, "elm,action,unfocus", "elm");
_elm_code_widget_refresh(obj, NULL);