From 5ef6ca21ab9e1cf4f69254234d190a634b777d52 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 09:38:31 +0300 Subject: Remove deprecated Cocoa OpenGL and private compatibility APIs --- src/platform/wayland/api.h | 3 --- src/platform/wayland/backend.c | 23 ----------------------- src/platform/wayland/clipboard.c | 12 ------------ src/platform/wayland/clipboard.h | 2 -- src/platform/wayland/internal.h | 2 -- src/platform/wayland/keyboard.c | 25 ------------------------- src/platform/wayland/popup.c | 17 +++++------------ src/platform/wayland/surface.c | 3 --- 8 files changed, 5 insertions(+), 82 deletions(-) (limited to 'src/platform/wayland') diff --git a/src/platform/wayland/api.h b/src/platform/wayland/api.h index 9670af1..69f61b1 100644 --- a/src/platform/wayland/api.h +++ b/src/platform/wayland/api.h @@ -12,8 +12,6 @@ uint32_t wayland_display_caps(const struct wayland_display *d); int wayland_display_dispatch_timeout(struct wayland_display *d, int timeout_ms); void wayland_display_flush(struct wayland_display *d); int wayland_display_modifiers(const struct wayland_display *d); -void wayland_display_copy(struct wayland_display *d, enum yasl_private_selection sel, const char *text); -void wayland_display_paste(struct wayland_display *d, enum yasl_private_selection sel, struct wayland_surface *target); bool wayland_display_copy_text(struct wayland_display *d, enum yasl_private_selection sel, const char *text); bool wayland_display_request_paste(struct wayland_display *d, enum yasl_private_selection sel, struct wayland_surface *target, uint64_t request_id); @@ -28,7 +26,6 @@ void wayland_surface_set_callbacks(struct wayland_surface *s, const struct yasl_ void wayland_surface_set_title(struct wayland_surface *s, const char *title); void wayland_surface_schedule_redraw(struct wayland_surface *s); bool wayland_surface_present(struct wayland_surface *s, const struct yasl_private_framebuffer *fb, const struct yasl_private_damage_list *damage); -bool wayland_surface_poll_event(struct wayland_surface *s, struct yasl_private_event *ev); struct yasl_private_geometry wayland_surface_geometry(const struct wayland_surface *s); struct yasl_private_timing wayland_surface_timing(const struct wayland_surface *s); void wayland_surface_set_cursor(struct wayland_surface *s, enum yasl_private_cursor cursor); diff --git a/src/platform/wayland/backend.c b/src/platform/wayland/backend.c index b3337cc..7ac1c65 100644 --- a/src/platform/wayland/backend.c +++ b/src/platform/wayland/backend.c @@ -40,11 +40,6 @@ static int impl_display_double_click_ms(const struct yasl_private_display *d) return portal_double_click_ms(); } -static void impl_display_copy(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text) -{ - wayland_display_copy((struct wayland_display *)d, sel, text); -} - static bool impl_display_copy_text(struct yasl_private_display *d, enum yasl_private_selection sel, const char *text) { @@ -53,11 +48,6 @@ static bool impl_display_copy_text(struct yasl_private_display *d, enum yasl_pri return ok; } -static void impl_display_paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target) -{ - wayland_display_paste((struct wayland_display *)d, sel, (struct wayland_surface *)target); -} - static bool impl_display_request_paste(struct yasl_private_display *d, enum yasl_private_selection sel, struct yasl_surface *target, uint64_t request_id) { @@ -348,11 +338,6 @@ static bool impl_surface_present(struct yasl_surface *s, const struct yasl_priva return wayland_surface_present((struct wayland_surface *)s, fb, damage); } -static bool impl_surface_poll_event(struct yasl_surface *s, struct yasl_private_event *ev) -{ - return wayland_surface_poll_event((struct wayland_surface *)s, ev); -} - static struct yasl_private_geometry impl_surface_geometry(const struct yasl_surface *s) { return wayland_surface_geometry((const struct wayland_surface *)s); @@ -449,11 +434,6 @@ static void *impl_surface_get_native_handle(struct yasl_surface *s) const struct yasl_private_backend_ops yasl_private_wayland_backend = { #if YASL_HAS_EGL - .surface_create_gl = impl_surface_create_gl, - .gl_make_current = impl_gl_make_current, - .gl_get_proc_address = impl_gl_get_proc_address, - .gl_swap_interval = impl_gl_swap_interval, - .gl_swap_buffers = impl_gl_swap_buffers, #endif .surface_update_text_input = impl_surface_update_text_input, .type = YASL_PRIVATE_BACKEND_WAYLAND, @@ -464,8 +444,6 @@ const struct yasl_private_backend_ops yasl_private_wayland_backend = { .display_flush = impl_display_flush, .display_modifiers = impl_display_modifiers, .display_double_click_ms = impl_display_double_click_ms, - .display_copy = impl_display_copy, - .display_paste = impl_display_paste, .display_copy_text = impl_display_copy_text, .display_request_paste = impl_display_request_paste, .display_drag_start = impl_display_drag_start, @@ -484,7 +462,6 @@ const struct yasl_private_backend_ops yasl_private_wayland_backend = { .surface_set_title = impl_surface_set_title, .surface_schedule_redraw = impl_surface_schedule_redraw, .surface_present = impl_surface_present, - .surface_poll_event = impl_surface_poll_event, .surface_set_pointer_mode = impl_surface_set_pointer_mode, .surface_geometry = impl_surface_geometry, .surface_timing = impl_surface_timing, diff --git a/src/platform/wayland/clipboard.c b/src/platform/wayland/clipboard.c index cf39b6c..9a75953 100644 --- a/src/platform/wayland/clipboard.c +++ b/src/platform/wayland/clipboard.c @@ -600,12 +600,6 @@ bool clipboard_copy(struct clipboard *c, const char *text, uint32_t serial) return true; } -void clipboard_paste(struct clipboard *c, struct wl_surface *target) -{ - if (c && target) - (void)clipboard_request_paste(c, YASL_PRIVATE_CLIPBOARD, target, 0); -} - bool clipboard_copy_primary(struct clipboard *c, const char *text, uint32_t serial) { if (!c || !c->primary_device || !c->primary_manager) { errno = ENOTSUP; return false; } @@ -627,12 +621,6 @@ bool clipboard_copy_primary(struct clipboard *c, const char *text, uint32_t seri return true; } -void clipboard_paste_primary(struct clipboard *c, struct wl_surface *target) -{ - if (c && target) - (void)clipboard_request_paste(c, YASL_PRIVATE_PRIMARY, target, 0); -} - bool clipboard_request_paste(struct clipboard *c, enum yasl_private_selection selection, struct wl_surface *target, uint64_t request_id) { diff --git a/src/platform/wayland/clipboard.h b/src/platform/wayland/clipboard.h index d03df17..7ab1719 100644 --- a/src/platform/wayland/clipboard.h +++ b/src/platform/wayland/clipboard.h @@ -25,12 +25,10 @@ void clipboard_destroy(struct clipboard *); bool clipboard_set_seat(struct clipboard *, struct wl_seat *); void clipboard_set_primary_manager(struct clipboard *, struct zwp_primary_selection_device_manager_v1 *); bool clipboard_copy(struct clipboard *, const char *, uint32_t); -void clipboard_paste(struct clipboard *, struct wl_surface *target); bool clipboard_request_paste(struct clipboard *, enum yasl_private_selection, struct wl_surface *target, uint64_t request_id); void clipboard_forget_surface(struct clipboard *, struct wl_surface *); bool clipboard_copy_primary(struct clipboard *, const char *, uint32_t); -void clipboard_paste_primary(struct clipboard *, struct wl_surface *target); typedef void (*clipboard_drag_fn)(enum yasl_private_drag_event, struct wl_surface *on, double x, double y, void *); diff --git a/src/platform/wayland/internal.h b/src/platform/wayland/internal.h index 92108c1..ff1b18f 100644 --- a/src/platform/wayland/internal.h +++ b/src/platform/wayland/internal.h @@ -244,8 +244,6 @@ struct wayland_display { struct wp_commit_timing_manager_v1 *commit_timing_mgr; struct xkb_context *xkb_ctx; struct yasl_private_loop *loop; - const struct yasl_private_display_cbs *cbs; - void *ud; char *app_id; struct xdg_toplevel_drag_manager_v1 *toplevel_drag_mgr; struct conn_drag drag; diff --git a/src/platform/wayland/keyboard.c b/src/platform/wayland/keyboard.c index 6f9dec9..9637341 100644 --- a/src/platform/wayland/keyboard.c +++ b/src/platform/wayland/keyboard.c @@ -425,11 +425,6 @@ int wayland_display_modifiers(const struct wayland_display *c) return c ? seat_modifiers(c->active_seat ? c->active_seat : c->seats) : 0; } -void wayland_display_copy(struct wayland_display *c, enum yasl_private_selection sel, const char *text) -{ - (void)wayland_display_copy_text(c, sel, text); -} - bool wayland_display_copy_text(struct wayland_display *c, enum yasl_private_selection sel, const char *text) { @@ -453,21 +448,6 @@ bool wayland_display_copy_text(struct wayland_display *c, enum yasl_private_sele return ok; } -void wayland_display_paste(struct wayland_display *c, enum yasl_private_selection sel, struct wayland_surface *target) -{ - struct seat *s = c ? (c->active_seat ? c->active_seat : c->seats) : NULL; - if (!target || target->closed || target->destroyed) return; - if (!s || !s->clipboard) { - yasl_private_surface_complete_paste(&target->base, 0, - YASL_PRIVATE_TRANSFER_UNAVAILABLE, NULL, 0); - return; - } - if (sel == YASL_PRIVATE_PRIMARY) - clipboard_paste_primary(s->clipboard, target->surface); - else - clipboard_paste(s->clipboard, target->surface); -} - bool wayland_display_request_paste(struct wayland_display *c, enum yasl_private_selection sel, struct wayland_surface *target, uint64_t request_id) { @@ -485,8 +465,3 @@ bool wayland_display_request_paste(struct wayland_display *c, enum yasl_private_ if (!ok) errno = ENOMEM; return ok; } - -bool wayland_surface_poll_event(struct wayland_surface *w, struct yasl_private_event *ev) -{ - return w && ev && input_queue_pop(&w->input, ev); -} diff --git a/src/platform/wayland/popup.c b/src/platform/wayland/popup.c index c563eb4..1ae4805 100644 --- a/src/platform/wayland/popup.c +++ b/src/platform/wayland/popup.c @@ -27,15 +27,14 @@ static bool popup_spec_valid(const struct wayland_surface *parent, const struct yasl_private_popup_spec *spec) { if (!parent || !spec) return false; - if (spec->positioner_explicit && - (spec->anchor_edges > XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT || + if (spec->anchor_edges > XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT || spec->gravity > XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT || (spec->constraints & ~(unsigned)(XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X | - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y)))) + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y))) return false; int64_t x = (int64_t)spec->anchor.x - parent->content.x; int64_t y = (int64_t)spec->anchor.y - parent->content.y; @@ -121,15 +120,9 @@ static struct xdg_positioner *popup_positioner(struct wayland_surface *w, yasl_private_scale_to_logical(at.x, scale), yasl_private_scale_to_logical(at.y, scale), aw > 0 ? aw : 1, ah > 0 ? ah : 1); - uint32_t anchor = spec->positioner_explicit ? spec->anchor_edges : - (spec->beside ? XDG_POSITIONER_ANCHOR_TOP_RIGHT : XDG_POSITIONER_ANCHOR_TOP_LEFT); - uint32_t gravity = spec->positioner_explicit ? spec->gravity : - XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT; - uint32_t constraints = spec->positioner_explicit ? spec->constraints : - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X | - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y | - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y; + uint32_t anchor = spec->anchor_edges; + uint32_t gravity = spec->gravity; + uint32_t constraints = spec->constraints; xdg_positioner_set_anchor(pos, anchor); xdg_positioner_set_gravity(pos, gravity); xdg_positioner_set_constraint_adjustment(pos, constraints); diff --git a/src/platform/wayland/surface.c b/src/platform/wayland/surface.c index e04a594..635c905 100644 --- a/src/platform/wayland/surface.c +++ b/src/platform/wayland/surface.c @@ -347,9 +347,6 @@ struct wayland_display *wayland_display_open(struct yasl_private_loop *loop, con c->base.loop = c->loop; if (!c->loop) goto err; if (spec) { - c->base.callbacks = spec->cbs ? *spec->cbs : (struct yasl_private_display_cbs){0}; - c->cbs = &c->base.callbacks; - c->ud = spec->ud; if (spec->app_id) c->app_id = strdup(spec->app_id); c->base.app_id = c->app_id; } -- cgit v1.2.3