summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-12-06 21:38:50 -0500
committerKristian Høgsberg <krh@bitplanet.net>2010-12-06 21:38:50 -0500
commit4685fa324f5692c5690460905024902359e85e2a (patch)
tree3ee81aeb0e1cff5a14494d0f604b06fe83831914
parent02ef1c1aca7f05ffcd6081af4e1135186614b7d3 (diff)
Pass timestamp in surface destroy callback
-rw-r--r--compositor/compositor.c12
-rw-r--r--wayland/wayland-server.c8
-rw-r--r--wayland/wayland-server.h2
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 {