summaryrefslogtreecommitdiff
path: root/src/wayland/surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wayland/surface.c')
-rw-r--r--src/wayland/surface.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/wayland/surface.c b/src/wayland/surface.c
index 8de4992..ef355ab 100644
--- a/src/wayland/surface.c
+++ b/src/wayland/surface.c
@@ -128,7 +128,7 @@ static inline bool display_has_immediate_work(const struct wayland_display *c)
if (unlikely(!c || c->lost)) return false;
for (struct wayland_surface *w = c->surfaces; w; w = w->conn_next) {
bool ready_draw = w->want_draw & (w->frame_cb == NULL) & w->configured;
- bool has_input = (w->input.count > 0);
+ bool has_input = (w->input.count > 0 || w->input.reset_pending);
if (unlikely((ready_draw | has_input) & !w->closed))
return true;
}
@@ -250,7 +250,8 @@ struct wayland_display *wayland_display_open(struct yasl_loop *loop, const struc
}
if (!c->loop) goto err;
if (spec) {
- c->cbs = spec->cbs;
+ c->base.callbacks = spec->cbs ? *spec->cbs : (struct yasl_display_cbs){0};
+ c->cbs = &c->base.callbacks;
c->ud = spec->ud;
if (spec->app_id) c->app_id = strdup(spec->app_id);
}
@@ -288,7 +289,7 @@ void wayland_display_close(struct wayland_display *c)
uint32_t wayland_display_caps(const struct wayland_display *c)
{
if (!c) return 0;
- uint32_t caps = YASL_CAP_POPUPS | YASL_CAP_CSD;
+ uint32_t caps = YASL_CAP_POPUPS | YASL_CAP_CSD | YASL_CAP_FRAME_PACING;
struct seat *s = conn_active_seat(c);
const struct wl_data_device *device = s ? clipboard_data_device(s->clipboard) : NULL;
if (device && wl_data_device_get_version((struct wl_data_device *)device) >= 3)
@@ -318,8 +319,6 @@ static void conn_unlink(struct wayland_surface *w)
break;
}
}
- if (c->paste_target == w)
- c->paste_target = NULL;
for (struct seat *s = c->seats; s; s = s->next)
seat_forget_surface(s, w);
w->conn = NULL;
@@ -397,8 +396,8 @@ err:
void wayland_surface_set_callbacks(struct wayland_surface *w, const struct yasl_surface_cbs *cbs, void *ud)
{
if (w && !w->closed) {
- static const struct yasl_surface_cbs no_callbacks = {0};
- w->cbs = cbs ? cbs : &no_callbacks;
+ w->base.callbacks = cbs ? *cbs : (struct yasl_surface_cbs){0};
+ w->cbs = &w->base.callbacks;
w->ud = ud;
}
}