summaryrefslogtreecommitdiff
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
commit3f5699b2d6ed39322c4333ef34305ab445677435 (patch)
tree74885c576d6d5e442e93b38e3f02cef5049fb62a
parent57a7fe5cd8a3ce3091429974e7cc50429e3abe92 (diff)
fix more complaints on inwin shutdown and focus stuff
this fixes the rest of T958
-rw-r--r--src/lib/elm_win.c98
1 files changed, 58 insertions, 40 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 340517e87..7995382c7 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -234,6 +234,9 @@ _elm_win_on_resize_obj_changed_size_hints(void *data,
234 Evas *e, 234 Evas *e,
235 Evas_Object *obj, 235 Evas_Object *obj,
236 void *event_info); 236 void *event_info);
237static void
238_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
239
237#ifdef HAVE_ELEMENTARY_X 240#ifdef HAVE_ELEMENTARY_X
238static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd); 241static void _elm_win_xwin_update(Elm_Win_Smart_Data *sd);
239#endif 242#endif
@@ -1469,16 +1472,70 @@ _elm_win_focus_highlight_shutdown(Elm_Win_Smart_Data *sd)
1469} 1472}
1470 1473
1471static void 1474static void
1475_win_img_hide(void *data,
1476 Evas *e EINA_UNUSED,
1477 Evas_Object *obj EINA_UNUSED,
1478 void *event_info EINA_UNUSED)
1479{
1480 elm_widget_focus_hide_handle(data);
1481}
1482
1483static void
1484_win_img_mouse_up(void *data,
1485 Evas *e EINA_UNUSED,
1486 Evas_Object *obj EINA_UNUSED,
1487 void *event_info)
1488{
1489 Evas_Event_Mouse_Up *ev = event_info;
1490 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
1491 elm_widget_focus_mouse_up_handle(data);
1492}
1493
1494static void
1495_win_img_focus_in(void *data,
1496 Evas *e EINA_UNUSED,
1497 Evas_Object *obj EINA_UNUSED,
1498 void *event_info EINA_UNUSED)
1499{
1500 elm_widget_focus_steal(data);
1501}
1502
1503static void
1504_win_img_focus_out(void *data,
1505 Evas *e EINA_UNUSED,
1506 Evas_Object *obj EINA_UNUSED,
1507 void *event_info EINA_UNUSED)
1508{
1509 elm_widget_focused_object_clear(data);
1510}
1511
1512static void
1472_elm_win_on_img_obj_del(void *data, 1513_elm_win_on_img_obj_del(void *data,
1473 Evas *e EINA_UNUSED, 1514 Evas *e EINA_UNUSED,
1474 Evas_Object *obj EINA_UNUSED, 1515 Evas_Object *obj EINA_UNUSED,
1475 void *event_info EINA_UNUSED) 1516 void *event_info EINA_UNUSED)
1476{ 1517{
1477 ELM_WIN_DATA_GET(data, sd); 1518 ELM_WIN_DATA_GET(data, sd);
1519 _elm_win_img_callbacks_del(sd->obj, sd->img_obj);
1478 sd->img_obj = NULL; 1520 sd->img_obj = NULL;
1479} 1521}
1480 1522
1481static void 1523static void
1524_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
1525{
1526 evas_object_event_callback_del_full
1527 (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1528 evas_object_event_callback_del_full
1529 (imgobj, EVAS_CALLBACK_HIDE, _win_img_hide, obj);
1530 evas_object_event_callback_del_full
1531 (imgobj, EVAS_CALLBACK_MOUSE_UP, _win_img_mouse_up, obj);
1532 evas_object_event_callback_del_full
1533 (imgobj, EVAS_CALLBACK_FOCUS_IN, _win_img_focus_in, obj);
1534 evas_object_event_callback_del_full
1535 (imgobj, EVAS_CALLBACK_FOCUS_OUT, _win_img_focus_out, obj);
1536}
1537
1538static void
1482_elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 1539_elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1483{ 1540{
1484 Elm_Win_Smart_Data *sd = _pd; 1541 Elm_Win_Smart_Data *sd = _pd;
@@ -1526,8 +1583,7 @@ _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1526 1583
1527 if (sd->img_obj) 1584 if (sd->img_obj)
1528 { 1585 {
1529 evas_object_event_callback_del_full 1586 _elm_win_img_callbacks_del(obj, sd->img_obj);
1530 (sd->img_obj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
1531 sd->img_obj = NULL; 1587 sd->img_obj = NULL;
1532 } 1588 }
1533 else 1589 else
@@ -2653,44 +2709,6 @@ _debug_key_down(void *data EINA_UNUSED,
2653#endif 2709#endif
2654 2710
2655static void 2711static void
2656_win_img_hide(void *data,
2657 Evas *e EINA_UNUSED,
2658 Evas_Object *obj EINA_UNUSED,
2659 void *event_info EINA_UNUSED)
2660{
2661 elm_widget_focus_hide_handle(data);
2662}
2663
2664static void
2665_win_img_mouse_up(void *data,
2666 Evas *e EINA_UNUSED,
2667 Evas_Object *obj EINA_UNUSED,
2668 void *event_info)
2669{
2670 Evas_Event_Mouse_Up *ev = event_info;
2671 if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
2672 elm_widget_focus_mouse_up_handle(data);
2673}
2674
2675static void
2676_win_img_focus_in(void *data,
2677 Evas *e EINA_UNUSED,
2678 Evas_Object *obj EINA_UNUSED,
2679 void *event_info EINA_UNUSED)
2680{
2681 elm_widget_focus_steal(data);
2682}
2683
2684static void
2685_win_img_focus_out(void *data,
2686 Evas *e EINA_UNUSED,
2687 Evas_Object *obj EINA_UNUSED,
2688 void *event_info EINA_UNUSED)
2689{
2690 elm_widget_focused_object_clear(data);
2691}
2692
2693static void
2694_win_inlined_image_set(Elm_Win_Smart_Data *sd) 2712_win_inlined_image_set(Elm_Win_Smart_Data *sd)
2695{ 2713{
2696 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE); 2714 evas_object_image_alpha_set(sd->img_obj, EINA_FALSE);