From d4d13e616cb15ef22479d9cb97922af93317a01a Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 17:05:59 +0300 Subject: Add desktop services: open URI, notify, appearance, bell, and paths wsap_term keeps per-platform code for opening links, notifications, the bell, high-contrast detection, the executable and bundle paths, and the default locale. These now live behind . On Linux, src/platform/freedesktop serves both backends. Opening a URI runs xdg-open from PATH through a double fork, so the opener gets default signal dispositions, an empty mask, a new session, and none of the application's descriptors. Notifications and the Settings portal use the session bus through libdbus-1, an optional dependency behind -Ddbus. Appearance falls back to GTK_THEME without a portal. The bell uses xdg-system-bell on Wayland and the XKB bell on X11. Cocoa implements the same calls with NSWorkspace, UserNotifications, the effective appearance, NSBeep, the bundle, and CFLocale. That code is not built or run here; it needs a macOS check. The desktop test runs under dbus-run-session against a fake notification server and portal, and uses a fake xdg-open to check argument passing, signal state, and descriptor inheritance. Co-Authored-By: Claude Opus 5.5 --- src/platform/wayland/shell.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/platform/wayland/shell.c') diff --git a/src/platform/wayland/shell.c b/src/platform/wayland/shell.c index a12bd4d..8795989 100644 --- a/src/platform/wayland/shell.c +++ b/src/platform/wayland/shell.c @@ -214,6 +214,8 @@ static void registry_global(void *data, struct wl_registry *registry, } else if (strcmp(interface, zwp_pointer_constraints_v1_interface.name) == 0) { c->pointer_constraints = wl_registry_bind(registry, name, &zwp_pointer_constraints_v1_interface, 1); + } else if (strcmp(interface, xdg_system_bell_v1_interface.name) == 0) { + c->system_bell = wl_registry_bind(registry, name, &xdg_system_bell_v1_interface, 1); } else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0) { c->scale_mgr = wl_registry_bind(registry, name, &wp_fractional_scale_manager_v1_interface, 1); @@ -403,3 +405,10 @@ int surface_init_shell(struct wayland_surface *w, const char *title) } return 0; } + +bool wayland_surface_bell(struct wayland_surface *w) +{ + if (!w || w->closed || !w->conn || !w->conn->system_bell || !w->surface) return false; + xdg_system_bell_v1_ring(w->conn->system_bell, w->surface); + return true; +} -- cgit v1.2.3