forked from enlightenment/efl
elm_cnp: fix selections for wl windows and FAKE wins
don't use hardcoded seat names and attempt to use wl protocol for FAKE wins
This commit is contained in:
parent
f052a2c02f
commit
804ce5f514
|
@ -2893,11 +2893,10 @@ _wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i
|
||||||
static Ecore_Wl2_Input *
|
static Ecore_Wl2_Input *
|
||||||
_wl_default_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj)
|
_wl_default_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eo *seat, *parent2;
|
Eo *seat, *parent2, *ewin;
|
||||||
|
|
||||||
// FIXME: In wayland the default seat is not named "default" but "seat-X"
|
if (obj)
|
||||||
// where X may be 0 or really anything else.
|
{
|
||||||
if (!obj) return ecore_wl2_display_input_find_by_name(ecore_wl2_window_display_get(win), "default");
|
|
||||||
|
|
||||||
// FIXME (there might be a better solution):
|
// FIXME (there might be a better solution):
|
||||||
// In case of inwin, we want to use the main wl2 window for cnp, but obj
|
// In case of inwin, we want to use the main wl2 window for cnp, but obj
|
||||||
|
@ -2905,6 +2904,20 @@ _wl_default_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj)
|
||||||
// match the window win.
|
// match the window win.
|
||||||
parent2 = elm_widget_parent2_get(elm_widget_top_get(obj));
|
parent2 = elm_widget_parent2_get(elm_widget_top_get(obj));
|
||||||
if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
|
if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
|
||||||
|
/* fake win means canvas seat id will not match protocol seat id */
|
||||||
|
ewin = elm_win_get(obj);
|
||||||
|
if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!obj)
|
||||||
|
{
|
||||||
|
Ecore_Wl2_Input *input;
|
||||||
|
Eina_Iterator *it;
|
||||||
|
it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(win));
|
||||||
|
EINA_ITERATOR_FOREACH(it, input) break;
|
||||||
|
eina_iterator_free(it);
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
seat = evas_canvas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
|
seat = evas_canvas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
|
||||||
|
|
Loading…
Reference in New Issue