[PATCH wayland] wayland-server: fix frame list behaviour

Tiago Vignatti tiago.vignatti at intel.com
Thu Jul 14 08:49:49 PDT 2011


Enqueue new key events on the beginning of the list and select the last
one first to be posted.

We may need a wl_list_for_each_reverse_safe there.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 wayland/wayland-server.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c
index 176859b..a566368 100644
--- a/wayland/wayland-server.c
+++ b/wayland/wayland-server.c
@@ -570,7 +570,7 @@ display_frame(struct wl_client *client,
 	listener->surface = surface;
 	wl_list_init(&listener->resource.destroy_listener_list);
 	wl_list_insert(client->resource_list.prev, &listener->resource.link);
-	wl_list_insert(display->frame_list.prev, &listener->link);
+	wl_list_insert(&display->frame_list, &listener->link);
 }
 
 struct wl_display_interface display_interface = {
@@ -703,9 +703,9 @@ WL_EXPORT void
 wl_display_post_frame(struct wl_display *display, struct wl_surface *surface,
 		      uint32_t time)
 {
-	struct wl_frame_listener *listener, *next;
+	struct wl_frame_listener *listener;
 
-	wl_list_for_each_safe(listener, next, &display->frame_list, link) {
+	wl_list_for_each_reverse(listener, &display->frame_list, link) {
 		if (listener->surface != surface)
 			continue;
 		wl_client_post_event(listener->client, &display->object,
-- 
1.7.2.2



More information about the wayland-devel mailing list