wayland/keyboard: Stop using temporary wl_list 'l'

The variable name 'l' usually refers to a GList iterator, but here it's
just a short hand for a specific list. Stop using this shorthand, since
it just makes it harder to read what list is used.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
This commit is contained in:
Jonas Ådahl 2016-09-20 16:46:16 +08:00
parent d8a0275418
commit 1c28f85173

View File

@ -264,10 +264,8 @@ meta_wayland_keyboard_broadcast_key (MetaWaylandKeyboard *keyboard,
uint32_t state) uint32_t state)
{ {
struct wl_resource *resource; struct wl_resource *resource;
struct wl_list *l;
l = &keyboard->focus_resource_list; if (!wl_list_empty (&keyboard->focus_resource_list))
if (!wl_list_empty (l))
{ {
MetaWaylandInputDevice *input_device = MetaWaylandInputDevice *input_device =
META_WAYLAND_INPUT_DEVICE (keyboard); META_WAYLAND_INPUT_DEVICE (keyboard);
@ -275,7 +273,7 @@ meta_wayland_keyboard_broadcast_key (MetaWaylandKeyboard *keyboard,
keyboard->key_serial = keyboard->key_serial =
meta_wayland_input_device_next_serial (input_device); meta_wayland_input_device_next_serial (input_device);
wl_resource_for_each (resource, l) wl_resource_for_each (resource, &keyboard->focus_resource_list)
{ {
wl_keyboard_send_key (resource, keyboard->key_serial, time, key, state); wl_keyboard_send_key (resource, keyboard->key_serial, time, key, state);
} }
@ -350,10 +348,8 @@ static void
meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard) meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
{ {
struct wl_resource *resource; struct wl_resource *resource;
struct wl_list *l;
l = &keyboard->focus_resource_list; if (!wl_list_empty (&keyboard->focus_resource_list))
if (!wl_list_empty (l))
{ {
MetaWaylandInputDevice *input_device = MetaWaylandInputDevice *input_device =
META_WAYLAND_INPUT_DEVICE (keyboard); META_WAYLAND_INPUT_DEVICE (keyboard);
@ -361,7 +357,7 @@ meta_wayland_keyboard_broadcast_modifiers (MetaWaylandKeyboard *keyboard)
serial = meta_wayland_input_device_next_serial (input_device); serial = meta_wayland_input_device_next_serial (input_device);
wl_resource_for_each (resource, l) wl_resource_for_each (resource, &keyboard->focus_resource_list)
keyboard_send_modifiers (keyboard, resource, serial); keyboard_send_modifiers (keyboard, resource, serial);
} }
} }
@ -837,16 +833,14 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
if (keyboard->focus_surface != NULL) if (keyboard->focus_surface != NULL)
{ {
struct wl_resource *resource; struct wl_resource *resource;
struct wl_list *l;
l = &keyboard->focus_resource_list; if (!wl_list_empty (&keyboard->focus_resource_list))
if (!wl_list_empty (l))
{ {
uint32_t serial; uint32_t serial;
serial = meta_wayland_input_device_next_serial (input_device); serial = meta_wayland_input_device_next_serial (input_device);
wl_resource_for_each (resource, l) wl_resource_for_each (resource, &keyboard->focus_resource_list)
{ {
wl_keyboard_send_leave (resource, serial, keyboard->focus_surface->resource); wl_keyboard_send_leave (resource, serial, keyboard->focus_surface->resource);
} }
@ -861,7 +855,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
if (surface != NULL) if (surface != NULL)
{ {
struct wl_resource *resource; struct wl_resource *resource;
struct wl_list *l;
keyboard->focus_surface = surface; keyboard->focus_surface = surface;
wl_resource_add_destroy_listener (keyboard->focus_surface->resource, &keyboard->focus_surface_listener); wl_resource_add_destroy_listener (keyboard->focus_surface->resource, &keyboard->focus_surface_listener);
@ -870,13 +863,12 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
&keyboard->resource_list, &keyboard->resource_list,
wl_resource_get_client (keyboard->focus_surface->resource)); wl_resource_get_client (keyboard->focus_surface->resource));
l = &keyboard->focus_resource_list; if (!wl_list_empty (&keyboard->focus_resource_list))
if (!wl_list_empty (l))
{ {
keyboard->focus_serial = keyboard->focus_serial =
meta_wayland_input_device_next_serial (input_device); meta_wayland_input_device_next_serial (input_device);
wl_resource_for_each (resource, l) wl_resource_for_each (resource, &keyboard->focus_resource_list)
{ {
broadcast_focus (keyboard, resource); broadcast_focus (keyboard, resource);
} }