aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-18 16:15:55 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-18 16:15:55 +0900
commita4cbdd7c3933397cad6410243e3a16f9f29224f2 (patch)
treecb03cfed64f689c0b2fa330273899c7707391a3f /legacy/elementary/src/lib/elm_win.c
parentelm win - on shutdown some objects become null during shutdown so be quiet (diff)
downloadefl-a4cbdd7c3933397cad6410243e3a16f9f29224f2.tar.gz
fix more complaints on inwin shutdown and focus stuff
this fixes the rest of https://phab.enlightenment.org/T958
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c98
1 files changed, 58 insertions, 40 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 340517e87a..7995382c79 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -234,6 +234,9 @@ _elm_win_on_resize_obj_changed_size_hints(void *data,
Evas *e,
Evas_Object *obj,
void *event_info);
+static void
+_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
+
#ifdef HAVE_ELEMENTARY_X
static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
#endif
@@ -1469,16 +1472,70 @@ _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
}
static void
+_win_img_hide(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ elm_widget_focus_hide_handle(data);
+}
+
+static void
+_win_img_mouse_up(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info)
+{
+ Evas_Event_Mouse_Up *ev = event_info;
+ if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+ elm_widget_focus_mouse_up_handle(data);
+}
+
+static void
+_win_img_focus_in(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ elm_widget_focus_steal(data);
+}
+
+static void
+_win_img_focus_out(void *data,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ elm_widget_focused_object_clear(data);
+}
+
+static void
_elm_win_on_img_obj_del(void *data,
Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
ELM_WIN_DATA_GET(data, sd);
+ _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
sd->img_obj = NULL;
}
static void
+_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
+{
+ evas_object_event_callback_del_full
+ (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
+ evas_object_event_callback_del_full
+ (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
+ evas_object_event_callback_del_full
+ (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
+ evas_object_event_callback_del_full
+ (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
+ evas_object_event_callback_del_full
+ (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
+}
+
+static void
_elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Win_Smart_Data *sd = _pd;
@@ -1526,8 +1583,7 @@ _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
if (sd->img_obj)
{
- evas_object_event_callback_del_full
- (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
+ _elm_win_img_callbacks_del(obj, sd->img_obj);
sd->img_obj = NULL;
}
else
@@ -2653,44 +2709,6 @@ _debug_key_down(void *data EINA_UNUSED,
#endif
static void
-_win_img_hide(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
-{
- elm_widget_focus_hide_handle(data);
-}
-
-static void
-_win_img_mouse_up(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info)
-{
- Evas_Event_Mouse_Up *ev = event_info;
- if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
- elm_widget_focus_mouse_up_handle(data);
-}
-
-static void
-_win_img_focus_in(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
-{
- elm_widget_focus_steal(data);
-}
-
-static void
-_win_img_focus_out(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
-{
- elm_widget_focused_object_clear(data);
-}
-
-static void
_win_inlined_image_set(Elm_Win_Smart_Data *sd)
{
evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);