Move get_time() helper back into compositor
This commit is contained in:
+12
-2
@@ -154,6 +154,16 @@ wlsc_surface_create(struct wlsc_compositor *compositor,
|
|||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint32_t
|
||||||
|
get_time(void)
|
||||||
|
{
|
||||||
|
struct timeval tv;
|
||||||
|
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
|
||||||
|
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destroy_surface(struct wl_resource *resource, struct wl_client *client)
|
destroy_surface(struct wl_resource *resource, struct wl_client *client)
|
||||||
{
|
{
|
||||||
@@ -166,7 +176,7 @@ destroy_surface(struct wl_resource *resource, struct wl_client *client)
|
|||||||
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);
|
time = get_time();
|
||||||
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, time);
|
l->func(l, &surface->surface, time);
|
||||||
@@ -1149,7 +1159,7 @@ drag_cancel(struct wl_client *client, struct wl_drag *drag)
|
|||||||
if (drag->source == NULL || drag->source->client != client)
|
if (drag->source == NULL || drag->source->client != client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
time = wl_display_get_time(wl_client_get_display(client));
|
time = get_time();
|
||||||
wlsc_input_device_end_grab(device, time);
|
wlsc_input_device_end_grab(device, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -516,16 +516,6 @@ wl_display_destroy(struct wl_display *display)
|
|||||||
free(display);
|
free(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT uint32_t
|
|
||||||
wl_display_get_time(struct wl_display *display)
|
|
||||||
{
|
|
||||||
struct timeval tv;
|
|
||||||
|
|
||||||
gettimeofday(&tv, NULL);
|
|
||||||
|
|
||||||
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
wl_display_add_object(struct wl_display *display, struct wl_object *object)
|
wl_display_add_object(struct wl_display *display, struct wl_object *object)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -178,9 +178,6 @@ wl_display_set_compositor(struct wl_display *display,
|
|||||||
struct wl_compositor *compositor,
|
struct wl_compositor *compositor,
|
||||||
const struct wl_compositor_interface *implementation);
|
const struct wl_compositor_interface *implementation);
|
||||||
|
|
||||||
uint32_t
|
|
||||||
wl_display_get_time(struct wl_display *display);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wl_display_post_frame(struct wl_display *display, uint32_t msecs);
|
wl_display_post_frame(struct wl_display *display, uint32_t msecs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user