summaryrefslogtreecommitdiff
path: root/src/platform/freedesktop
AgeCommit message (Collapse)Author
11 daysSimplify the public API into one dense headerBerke Güzel
yasl.h now holds everything except Vulkan: 45 functions instead of 62, and three installed headers instead of ten. - One constructor: yasl_surface_create takes CPU, GL or NATIVE, with zero-initialized GL options meaning 3.2 core, RGBA8, D24S8. - Events carry action, mods, x, y and text at the top level; pen positions are now logical like pointer positions. - yasl_cpu_pixels/yasl_cpu_present draw into one persistent canvas, cutting three full-frame copies per frame. - yasl_surface_get_info, yasl_surface_request, YASL_CURSOR_LOCKED, yasl_surface_set_text_input, yasl_surface_begin_move_resize and yasl_surface_get_native replace groups of narrower calls. - Interactive calls drop the decorative trigger event argument. - yasl_wait_event returns 0 only on timeout or yasl_wake, the refresh callback runs only in native modal loops, focus loss sends INPUT_RESET, and a lost event no longer fails every later wait. - Unsupported operations and bad arguments report ENOTSUP and EINVAL instead of EIO; the keycodes header no longer needs C23. - The shared library gets a versioned SONAME and version macros. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysSimplify the public event and CPU APIBerke Güzel
Applications now need far less ceremony: hello.c is a 20-line loop that handles REFRESH, CLOSE and QUIT and draws into the surface's own pixels. - Fold GEOMETRY, STATE and FOCUS into one WINDOW event carrying size, scale and state; unchanged values send nothing. - Guarantee REFRESH once a window has a size and after every resize, never at size zero. - Merge DROP_HOVER into DROP with over/leave/data actions and give drag and drop actions enums. - Keep event strings valid until the next wait and drop yasl_event_release; empty or failed waits report NONE. - Replace copy-in presentation with a lent pixel buffer: yasl_cpu_pixels and yasl_cpu_present. - Remove yasl_poll_event, yasl_cpu_read_pixels, unused event fields and comments that restated names. - Wayland: resize floating windows in request_size instead of reporting it unsupported, and stop marking new GPU surfaces as Vulkan so yasl_vulkan_create_surface no longer fails with NATIVE_WINDOW_IN_USE. Also includes the in-progress public API refactor that was uncommitted in the tree (removal of the app/loop layer, new surface, GL and Vulkan entry points). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysReport the system double-click intervalBerke Güzel
wsap_term hardcodes 400 ms in three places to count clicks. yasl_display_double_click_ms() reads the interval from the system. X11 parses Net/DoubleClickTime from the XSETTINGS owner's property. Wayland has no protocol for it, so it asks the Settings portal for KDE's DoubleClickInterval, which KDE sends as a string and which exists only when the user set it, then GNOME's double-click. X11 without XSETTINGS asks the portal too. Cocoa reads NSEvent.doubleClickInterval. Missing or implausible values give YASL_DOUBLE_CLICK_MS_DEFAULT, 400 ms. The X11 state test covers the XSETTINGS parser in both byte orders and with truncation. The Xwayland test owns the settings selection. The desktop test serves both portal keys. The Cocoa path is not built or run here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysAdd desktop services: open URI, notify, appearance, bell, and pathsBerke Güzel
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 <yasl/desktop.h>. 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 <noreply@anthropic.com>