diff options
Diffstat (limited to 'yasl-gaps-report.md')
| -rw-r--r-- | yasl-gaps-report.md | 106 |
1 files changed, 90 insertions, 16 deletions
diff --git a/yasl-gaps-report.md b/yasl-gaps-report.md index a3f0b56..6078536 100644 --- a/yasl-gaps-report.md +++ b/yasl-gaps-report.md @@ -11,8 +11,9 @@ All the earlier yasl gaps are closed in code. Drag targets, drag images, and file drops now exist on every backend. They were checked by reading code, not at runtime on X11 or macOS. -The wsap_term audit of `83c2180` asks for new yasl API. Those requests are in -"Open requests" below. One gap remains on the project side. +The wsap_term audit of `83c2180` asked for six pieces of yasl API. All six +are implemented; see "Requests from the wsap_term audit" below. One gap +remains on the project side. ## Resolved in yasl @@ -82,24 +83,97 @@ allocation failure, or a Wayland text allocation failure. Suggested fix: send a pointer release to the UI on reset, or add a UI-level reset. -## Open requests from the wsap_term audit +## Requests from the wsap_term audit -These are new yasl API requests. They are ordered by how much app code each -one would remove. +All six requests are implemented. Linux paths are built and tested on Wayland +and X11. No Cocoa code was built or run. -| # | Request | Status | -| --- | --- | --- | -| 1.1 | Signal watching on a loop | In progress | -| 1.2 | Cross-thread wake or post for a plain `yasl_loop` | In progress | -| 1.3 | Native double-click interval | In progress | -| 1.4 | Held pointer buttons on motion | In progress | -| 1.5 | Desktop helpers: open URL, notify, bell, appearance, executable path, resource directory, locale | In progress | -| 1.6 | Drop URI decoding, framebuffer readback, `strndup` warning, `yasl_loop_kick` threading docs | In progress | +### 1.1 Signal watching -Requests that live in the term subproject (the extra-button encoding) belong -to that project, not to yasl. +Status: **Done** in `efca84e`. + +`yasl_loop_watch_signals()` and `yasl_loop_unwatch_signals()` deliver signals +to a callback on the loop thread. The contract the audit asked for: + +- Thread masks: YASL changes no thread's mask. Each signal gets a process-wide + handler with `SA_RESTART` and an empty handler mask. The handler may run on + any thread; it only records the signal and wakes the loop. A signal blocked + in every thread is never delivered. +- Platforms: the same handler-based design runs on Linux and macOS. There is + no `signalfd` path. +- `SIGCHLD`: callbacks run on the loop thread. Stopped and continued children + also raise it. +- One loop can watch a given signal at a time; another loop gets `EBUSY`. + Unwatch restores the saved actions. + +### 1.2 Cross-thread wake or post + +Status: **Done** in `efca84e`. + +- `yasl_loop_kick()` is documented as safe from any thread and from a signal + handler. +- `yasl_loop_post()` runs a function on the loop thread from any thread, in + posting order, with a plain `yasl_loop`. +- Cocoa dispatch did not wake for kicks, posts, or fd watches while waiting + for AppKit events. It now mirrors the loop's descriptors in a kqueue while + it waits. This also fixes `yasl_post_event()` wakeups under `yasl_run()` on + Cocoa. + +### 1.3 Native double-click interval + +Status: **Done** in `ac6f9f5`. + +`yasl_display_double_click_ms()` reads XSETTINGS `Net/DoubleClickTime` on X11, +the KDE `DoubleClickInterval` or GNOME `double-click` setting through the +Settings portal on Wayland (and on X11 without XSETTINGS), and +`NSEvent.doubleClickInterval` on Cocoa. It falls back to 400 ms. + +### 1.4 Held pointer buttons + +Status: **Done** in `cbd1fc7`. + +Every pointer event now has `buttons`, a `YASL_BUTTON_BIT()` mask of the +buttons held after the event. `INPUT_RESET` clears it. Wayland also clears it +on leave, because no release follows. X11 and Cocoa keep it across leave and +still deliver the release. + +### 1.5 Desktop helpers + +Status: **Done** in `d4d13e6`, with protocol code in `305a341`. + +`<yasl/desktop.h>` has `yasl_display_open_uri()`, `yasl_display_notify()`, +`yasl_display_appearance()`, `yasl_surface_bell()`, `yasl_executable_path()`, +`yasl_resource_dir()`, and `yasl_default_locale()`. + +- Linux opens URIs with `xdg-open` in a new session, with default signal + dispositions and no inherited descriptors. +- Notifications and appearance use libdbus-1, an optional dependency behind + `-Ddbus`. With it, the app no longer needs GIO for notifications. +- The bell uses xdg-system-bell on Wayland, the XKB bell on X11, and `NSBeep`. +- `yasl_display_open_uri()` checks only the URI syntax. Scheme policy, such as + `str_url_scheme_allowed`, stays in the app. +- `yasl_default_locale()` on Linux reads `LC_ALL`, `LC_CTYPE`, then `LANG`. + The app's Linux code always returns `en_US.UTF-8` today. + +### 1.6 Smaller items + +Status: **Done**. + +- Drop URIs: `yasl_drop_next_path()` decodes local paths from a drop payload + (`0437815`). +- Framebuffer readback: `yasl_surface_read_pixels()` copies the last presented + CPU frame (`b7944e4`). +- `strndup` warning: IME text is copied with `strlen` and a cap. An LTO release + build is warning-free (`6603122`). +- `yasl_loop_kick` threading: documented with 1.2 (`efca84e`). + +The extra-button encoding in the term subproject belongs to that project, not +to yasl. ## Not verified - Runtime behavior of items 1–3 on X11 and Cocoa. -- Any Cocoa path. Cocoa needs a macOS build and test. +- Any Cocoa path, including the dispatch wake, desktop services, double-click + interval, readback, and bell. Cocoa needs a macOS build and test. +- Notifications and the bell were not shown on a real desktop. The desktop + test checks the D-Bus messages against a fake service on a private bus. |
