efl/selection_manager: make selection manager a child of the app

Summary:
a selection manager is application-wide, not per-window. creating separate
managers for each window duplicates all callbacks for the window's display
server, guaranteeing broken behavior at any time when more than one window
exists

fix T6937

Reviewers: bu5hm4n, devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6937

Differential Revision: https://phab.enlightenment.org/D6483
This commit is contained in:
Mike Blumenkrantz 2018-07-03 12:39:26 -04:00 committed by Chris Michael
parent 7c50209baa
commit fff4d1ba97
2 changed files with 12 additions and 14 deletions

View File

@ -790,12 +790,14 @@ _x11_data_preparer_image(Sel_Manager_Seat_Selection *seat_sel EINA_UNUSED,
static Eina_Bool
_x11_win_filter(Eo *manager, Ecore_X_Window xwin)
{
Eo *win = efl_parent_get(manager);
if (!win) return EINA_TRUE;
win = efl_ui_widget_top_get(win);
if (!win) return EINA_TRUE;
if (xwin != elm_win_xwindow_get(win)) return EINA_TRUE;
return EINA_FALSE;
Eo *win;
const Eina_List *l;
EINA_LIST_FOREACH(_elm_win_list, l, win)
{
if (elm_win_window_id_get(win) == xwin) return EINA_FALSE;
}
return EINA_TRUE;
}
/*

View File

@ -25,16 +25,12 @@ static inline Eo *
_selection_manager_get(Eo *obj)
{
if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return NULL;
Eo *top = elm_widget_top_get(obj);
if (!top)
{
top = obj;
}
Eo *sel_man = efl_key_data_get(top, "__selection_manager");
Eo *app = efl_app_get();
Eo *sel_man = efl_key_data_get(app, "__selection_manager");
if (!sel_man)
{
sel_man = efl_add(EFL_SELECTION_MANAGER_CLASS, top);
efl_key_data_set(top, "__selection_manager", sel_man);
sel_man = efl_add(EFL_SELECTION_MANAGER_CLASS, app);
efl_key_data_set(app, "__selection_manager", sel_man);
}
return sel_man;
}