{
struct global *g;
struct global *global_pres = NULL;
- static struct wp_presentation *pres;
-
- if (pres)
- return pres;
+ struct wp_presentation *pres;
wl_list_for_each(g, &client->global_list, link) {
if (strcmp(g->interface, wp_presentation_interface.name))
};
static struct feedback *
-feedback_create(struct client *client, struct wl_surface *surface)
+feedback_create(struct client *client,
+ struct wl_surface *surface,
+ struct wp_presentation *pres)
{
struct feedback *fb;
fb = xzalloc(sizeof *fb);
fb->client = client;
- fb->obj = wp_presentation_feedback(get_presentation(client), surface);
+ fb->obj = wp_presentation_feedback(pres, surface);
wp_presentation_feedback_add_listener(fb->obj, &feedback_listener, fb);
return fb;
{
struct client *client;
struct feedback *fb;
+ struct wp_presentation *pres;
client = create_client_and_test_surface(100, 50, 123, 77);
assert(client);
+ pres = get_presentation(client);
wl_surface_attach(client->surface->wl_surface,
client->surface->buffer->proxy, 0, 0);
- fb = feedback_create(client, client->surface->wl_surface);
+ fb = feedback_create(client, client->surface->wl_surface, pres);
wl_surface_damage(client->surface->wl_surface, 0, 0, 100, 100);
wl_surface_commit(client->surface->wl_surface);