From 4685fa324f5692c5690460905024902359e85e2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 6 Dec 2010 21:38:50 -0500 Subject: [PATCH] Pass timestamp in surface destroy callback --- compositor/compositor.c | 12 +++++------- wayland/wayland-server.c | 8 ++------ wayland/wayland-server.h | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/compositor/compositor.c b/compositor/compositor.c index 88b323f..3e72c27 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -161,13 +161,15 @@ destroy_surface(struct wl_resource *resource, struct wl_client *client) container_of(resource, struct wlsc_surface, surface.resource); struct wlsc_compositor *compositor = surface->compositor; struct wl_listener *l, *next; + uint32_t time; wl_list_remove(&surface->link); glDeleteTextures(1, &surface->texture); + time = wl_display_get_time(compositor->wl_display); wl_list_for_each_safe(l, next, &surface->surface.destroy_listener_list, link) - l->func(l, &surface->surface); + l->func(l, &surface->surface, time); free(surface); @@ -486,14 +488,12 @@ wlsc_input_device_end_grab(struct wlsc_input_device *device, uint32_t time); static void lose_grab_surface(struct wl_listener *listener, - struct wl_surface *surface) + struct wl_surface *surface, uint32_t time) { struct wlsc_input_device *device = container_of(listener, struct wlsc_input_device, grab_listener); - uint32_t time; - time = wl_display_get_time(device->ec->wl_display); wlsc_input_device_end_grab(device, time); } @@ -604,12 +604,10 @@ const static struct wl_drag_interface drag_interface; static void drag_handle_surface_destroy(struct wl_listener *listener, - struct wl_surface *surface) + struct wl_surface *surface, uint32_t time) { struct wl_drag *drag = container_of(listener, struct wl_drag, drag_focus_listener); - uint32_t time = - wl_display_get_time(wl_client_get_display(surface->client)); if (drag->drag_focus == surface) wl_drag_set_pointer_focus(drag, NULL, time, 0, 0, 0, 0); diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c index ad0c3af..2ea9035 100644 --- a/wayland/wayland-server.c +++ b/wayland/wayland-server.c @@ -319,27 +319,23 @@ wl_client_destroy(struct wl_client *client) static void lose_pointer_focus(struct wl_listener *listener, - struct wl_surface *surface) + struct wl_surface *surface, uint32_t time) { struct wl_input_device *device = container_of(listener, struct wl_input_device, pointer_focus_listener); - uint32_t time; - time = wl_display_get_time(wl_client_get_display(surface->client)); wl_input_device_set_pointer_focus(device, NULL, time, 0, 0, 0, 0); } static void lose_keyboard_focus(struct wl_listener *listener, - struct wl_surface *surface) + struct wl_surface *surface, uint32_t time) { struct wl_input_device *device = container_of(listener, struct wl_input_device, keyboard_focus_listener); - uint32_t time; - time = wl_display_get_time(wl_client_get_display(surface->client)); wl_input_device_set_keyboard_focus(device, NULL, time); } diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h index 9bedf73..6115f60 100644 --- a/wayland/wayland-server.h +++ b/wayland/wayland-server.h @@ -122,7 +122,7 @@ struct wl_buffer { struct wl_listener { struct wl_list link; void (*func)(struct wl_listener *listener, - struct wl_surface *surface); + struct wl_surface *surface, uint32_t time); }; struct wl_surface { -- 2.7.4