Pass timestamp in surface destroy callback

This commit is contained in:
Kristian Høgsberg 2010-12-06 21:38:50 -05:00
parent 02ef1c1aca
commit 4685fa324f
3 changed files with 8 additions and 14 deletions

View File

@ -161,13 +161,15 @@ destroy_surface(struct wl_resource *resource, struct wl_client *client)
container_of(resource, struct wlsc_surface, surface.resource); container_of(resource, struct wlsc_surface, surface.resource);
struct wlsc_compositor *compositor = surface->compositor; struct wlsc_compositor *compositor = surface->compositor;
struct wl_listener *l, *next; struct wl_listener *l, *next;
uint32_t time;
wl_list_remove(&surface->link); wl_list_remove(&surface->link);
glDeleteTextures(1, &surface->texture); glDeleteTextures(1, &surface->texture);
time = wl_display_get_time(compositor->wl_display);
wl_list_for_each_safe(l, next, wl_list_for_each_safe(l, next,
&surface->surface.destroy_listener_list, link) &surface->surface.destroy_listener_list, link)
l->func(l, &surface->surface); l->func(l, &surface->surface, time);
free(surface); free(surface);
@ -486,14 +488,12 @@ wlsc_input_device_end_grab(struct wlsc_input_device *device, uint32_t time);
static void static void
lose_grab_surface(struct wl_listener *listener, lose_grab_surface(struct wl_listener *listener,
struct wl_surface *surface) struct wl_surface *surface, uint32_t time)
{ {
struct wlsc_input_device *device = struct wlsc_input_device *device =
container_of(listener, container_of(listener,
struct wlsc_input_device, grab_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); wlsc_input_device_end_grab(device, time);
} }
@ -604,12 +604,10 @@ const static struct wl_drag_interface drag_interface;
static void static void
drag_handle_surface_destroy(struct wl_listener *listener, drag_handle_surface_destroy(struct wl_listener *listener,
struct wl_surface *surface) struct wl_surface *surface, uint32_t time)
{ {
struct wl_drag *drag = struct wl_drag *drag =
container_of(listener, struct wl_drag, drag_focus_listener); 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) if (drag->drag_focus == surface)
wl_drag_set_pointer_focus(drag, NULL, time, 0, 0, 0, 0); wl_drag_set_pointer_focus(drag, NULL, time, 0, 0, 0, 0);

View File

@ -319,27 +319,23 @@ wl_client_destroy(struct wl_client *client)
static void static void
lose_pointer_focus(struct wl_listener *listener, lose_pointer_focus(struct wl_listener *listener,
struct wl_surface *surface) struct wl_surface *surface, uint32_t time)
{ {
struct wl_input_device *device = struct wl_input_device *device =
container_of(listener, struct wl_input_device, container_of(listener, struct wl_input_device,
pointer_focus_listener); 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); wl_input_device_set_pointer_focus(device, NULL, time, 0, 0, 0, 0);
} }
static void static void
lose_keyboard_focus(struct wl_listener *listener, lose_keyboard_focus(struct wl_listener *listener,
struct wl_surface *surface) struct wl_surface *surface, uint32_t time)
{ {
struct wl_input_device *device = struct wl_input_device *device =
container_of(listener, struct wl_input_device, container_of(listener, struct wl_input_device,
keyboard_focus_listener); 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); wl_input_device_set_keyboard_focus(device, NULL, time);
} }

View File

@ -122,7 +122,7 @@ struct wl_buffer {
struct wl_listener { struct wl_listener {
struct wl_list link; struct wl_list link;
void (*func)(struct wl_listener *listener, void (*func)(struct wl_listener *listener,
struct wl_surface *surface); struct wl_surface *surface, uint32_t time);
}; };
struct wl_surface { struct wl_surface {