summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2018-07-30 11:42:28 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-07-30 11:42:28 -0400
commit9342c1a3f4a26ae38c93fa3bf217e3bb973a0867 (patch)
tree0f1d163f66a32d8c1e96c01ba8184ed5b861ff61
parent5dba4f37a12dfa06d397f45802fb8819d4e77664 (diff)
efl_selection: reintroduce missing ELM_CNP_EVENT_SELECTION_CHANGED symbol.
Summary: During the 1.21 development cycle the symbol ELM_CNP_EVENT_SELECTION_CHANGED was lost. The commit which introduced this: e88bbaa1e314751e5c1a04dec7f1f179188428ae This patch re-introduced the symbol and expected behaviour. Reviewers: #committers, zmike, bu5hm4n, herb Reviewed By: #committers, zmike Subscribers: herb, ManMower, segfaultxavi, stefan_schmidt, cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6689
-rw-r--r--src/lib/elementary/efl_selection_manager.c31
-rw-r--r--src/lib/elementary/elm_main.c2
2 files changed, 28 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_selection_manager.c b/src/lib/elementary/efl_selection_manager.c
index 34c876270e..aa1ae9a394 100644
--- a/src/lib/elementary/efl_selection_manager.c
+++ b/src/lib/elementary/efl_selection_manager.c
@@ -45,6 +45,8 @@ static Ecore_Wl2_Input *_wl_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj, un
45static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel); 45static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Seat_Selection *seat_sel);
46#endif 46#endif
47 47
48EAPI int ELM_CNP_EVENT_SELECTION_CHANGED = -1;
49
48static Sel_Manager_Seat_Selection * 50static Sel_Manager_Seat_Selection *
49_sel_manager_seat_selection_get(Efl_Selection_Manager_Data *pd, unsigned int seat) 51_sel_manager_seat_selection_get(Efl_Selection_Manager_Data *pd, unsigned int seat)
50{ 52{
@@ -845,6 +847,7 @@ _x11_fixes_selection_notify(void *data, int t EINA_UNUSED, void *event)
845{ 847{
846 Efl_Selection_Manager_Data *pd = data; 848 Efl_Selection_Manager_Data *pd = data;
847 Efl_Selection_Changed e; 849 Efl_Selection_Changed e;
850 Elm_Cnp_Event_Selection_Changed *_e;
848 Ecore_X_Event_Fixes_Selection_Notify *ev = event; 851 Ecore_X_Event_Fixes_Selection_Notify *ev = event;
849 Sel_Manager_Seat_Selection *seat_sel; 852 Sel_Manager_Seat_Selection *seat_sel;
850 Efl_Selection_Type type; 853 Efl_Selection_Type type;
@@ -870,8 +873,15 @@ _x11_fixes_selection_notify(void *data, int t EINA_UNUSED, void *event)
870 e.type = type; 873 e.type = type;
871 e.seat = 1; /* under x11 this is always the default seat */ 874 e.seat = 1; /* under x11 this is always the default seat */
872 e.exist = !!ev->owner; 875 e.exist = !!ev->owner;
876
877 _e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
878 EINA_SAFETY_ON_NULL_RETURN_VAL(_e, ECORE_CALLBACK_RENEW);
879 _e->type = type;
880 _e->seat_id = 1;
881 _e->exists = e.exist;
882
883 ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, NULL, NULL);
873 efl_event_callback_call(sel->owner, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e); 884 efl_event_callback_call(sel->owner, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
874 //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, NULL, NULL);
875 885
876 return ECORE_CALLBACK_RENEW; 886 return ECORE_CALLBACK_RENEW;
877} 887}
@@ -2599,16 +2609,19 @@ _wl_efl_sel_manager_selection_set(Efl_Selection_Manager_Data *pd,
2599 return _update_sel_lost_list(owner, type, seat_sel); 2609 return _update_sel_lost_list(owner, type, seat_sel);
2600} 2610}
2601 2611
2602/*static void 2612static void
2603_wl_selection_changed_free(void *data, void *ev EINA_UNUSED) 2613_wl_selection_changed_free(void *data, void *ev)
2604{ 2614{
2605 ecore_wl2_display_disconnect(data); 2615 ecore_wl2_display_disconnect(data);
2606}*/ 2616
2617 free(ev);
2618}
2607 2619
2608static Eina_Bool 2620static Eina_Bool
2609_wl_selection_changed(void *data, int type EINA_UNUSED, void *event) 2621_wl_selection_changed(void *data, int type EINA_UNUSED, void *event)
2610{ 2622{
2611 Efl_Selection_Manager_Data *pd = data; 2623 Efl_Selection_Manager_Data *pd = data;
2624 Elm_Cnp_Event_Selection_Changed *_e;
2612 Sel_Manager_Seat_Selection *seat_sel; 2625 Sel_Manager_Seat_Selection *seat_sel;
2613 Sel_Manager_Selection *sel; 2626 Sel_Manager_Selection *sel;
2614 Efl_Selection_Changed e; 2627 Efl_Selection_Changed e;
@@ -2627,7 +2640,15 @@ _wl_selection_changed(void *data, int type EINA_UNUSED, void *event)
2627 /* connect again to add ref */ 2640 /* connect again to add ref */
2628 e.display = ecore_wl2_display_connect(ecore_wl2_display_name_get(ev->display)); 2641 e.display = ecore_wl2_display_connect(ecore_wl2_display_name_get(ev->display));
2629 e.exist = !!ecore_wl2_dnd_selection_get(seat); 2642 e.exist = !!ecore_wl2_dnd_selection_get(seat);
2630 //ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, e, _wl_selection_changed_free, ev->display); 2643
2644 _e = calloc(1, sizeof(Elm_Cnp_Event_Selection_Changed));
2645 EINA_SAFETY_ON_NULL_RETURN_VAL(_e, ECORE_CALLBACK_RENEW);
2646 _e->type = e.type;
2647 _e->seat_id = e.seat;
2648 _e->display = e.display;
2649 _e->exists = e.exist;
2650
2651 ecore_event_add(ELM_CNP_EVENT_SELECTION_CHANGED, _e, _wl_selection_changed_free, ev->display);
2631 efl_event_callback_call(sel->request_obj, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e); 2652 efl_event_callback_call(sel->request_obj, EFL_SELECTION_EVENT_SELECTION_CHANGED, &e);
2632 2653
2633 return ECORE_CALLBACK_RENEW; 2654 return ECORE_CALLBACK_RENEW;
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 425310c18e..fa38bf6dc9 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -403,6 +403,8 @@ elm_init(int argc, char **argv)
403 system_handlers[1] = 403 system_handlers[1] =
404 ecore_event_handler_add(ECORE_EVENT_LOCALE_CHANGED, _sys_lang_changed, NULL); 404 ecore_event_handler_add(ECORE_EVENT_LOCALE_CHANGED, _sys_lang_changed, NULL);
405 405
406 ELM_CNP_EVENT_SELECTION_CHANGED = ecore_event_type_new();
407
406 if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF) 408 if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
407 _elm_atspi_bridge_init(); 409 _elm_atspi_bridge_init();
408 if (!_elm_config->web_backend) 410 if (!_elm_config->web_backend)