ecore/wayland: Use eina_inlist instead of wl_list for inputs too.

This commit is contained in:
Rafael Antognolli 2013-11-04 14:24:59 -02:00
parent d1a9314cdd
commit b5e6855266
4 changed files with 8 additions and 10 deletions

View File

@ -180,8 +180,6 @@ ecore_wl_init(const char *name)
_ecore_wl_disp->idle_enterer =
ecore_idle_enterer_add(_ecore_wl_cb_idle_enterer, _ecore_wl_disp);
wl_list_init(&_ecore_wl_disp->inputs);
_ecore_wl_disp->wl.registry =
wl_display_get_registry(_ecore_wl_disp->wl.display);
wl_registry_add_listener(_ecore_wl_disp->wl.registry,
@ -426,14 +424,14 @@ _ecore_wl_shutdown(Eina_Bool close)
if ((close) && (!_ecore_wl_fatal_error))
{
Ecore_Wl_Output *out;
Ecore_Wl_Input *in, *tin;
Ecore_Wl_Input *in;
Ecore_Wl_Global *global;
Eina_Inlist *tmp;
EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->outputs, tmp, out)
_ecore_wl_output_del(out);
wl_list_for_each_safe(in, tin, &_ecore_wl_disp->inputs, link)
EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->inputs, tmp, in)
_ecore_wl_input_del(in);
EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->globals, tmp, global)

View File

@ -318,7 +318,7 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
input->seat =
wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
wl_list_insert(ewd->inputs.prev, &input->link);
ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));
wl_seat_add_listener(input->seat,
&_ecore_wl_seat_listener, input);
@ -385,7 +385,8 @@ _ecore_wl_input_del(Ecore_Wl_Input *input)
if (input->cursor_surface)
wl_surface_destroy(input->cursor_surface);
wl_list_remove(&input->link);
_ecore_wl_disp->inputs = eina_inlist_remove
(_ecore_wl_disp->inputs, EINA_INLIST_GET(input));
if (input->seat) wl_seat_destroy(input->seat);
if (input->repeat.tmr) ecore_timer_del(input->repeat.tmr);

View File

@ -72,7 +72,7 @@ struct _Ecore_Wl_Display
Ecore_Fd_Handler *fd_hdl;
Ecore_Idle_Enterer *idle_enterer;
struct wl_list inputs;
Eina_Inlist *inputs;
Eina_Inlist *outputs;
Eina_Inlist *globals; /** @since 1.7.6 */
@ -152,6 +152,7 @@ struct _Ecore_Wl_Window
struct _Ecore_Wl_Input
{
EINA_INLIST;
Ecore_Wl_Display *display;
struct wl_seat *seat;
struct wl_pointer *pointer;
@ -178,8 +179,6 @@ struct _Ecore_Wl_Input
unsigned int pointer_enter_serial;
int sx, sy;
struct wl_list link;
Ecore_Wl_Window *grab;
unsigned int grab_button;

View File

@ -104,7 +104,7 @@ ecore_wl_window_free(Ecore_Wl_Window *win)
eina_hash_del(_windows, _ecore_wl_window_id_str_get(win->id), win);
wl_list_for_each(input, &_ecore_wl_disp->inputs, link)
EINA_INLIST_FOREACH(_ecore_wl_disp->inputs, input)
{
if ((input->pointer_focus) && (input->pointer_focus == win))
input->pointer_focus = NULL;