<feed xmlns='http://www.w3.org/2005/Atom'>
<title>yasl.git/src/platform/cocoa/window.m, branch main</title>
<subtitle>[no description]</subtitle>
<id>https://git.wsap.dev/yasl.git/atom?h=main</id>
<link rel='self' href='https://git.wsap.dev/yasl.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/'/>
<updated>2026-10-15T17:38:14+00:00</updated>
<entry>
<title>Make the loop public and let the display drive it</title>
<updated>2026-10-15T17:38:14+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-15T17:38:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=c2832a63547e6328afde25bb3b8145267eadef47'/>
<id>urn:sha1:c2832a63547e6328afde25bb3b8145267eadef47</id>
<content type='text'>
An application that has its own descriptors and timers needed a second
loop next to yasl's, and could not see yasl's key-repeat timer, clipboard
pipes or reconnect timer. Now there is one wait: the application owns a
yasl_loop, and yasl_init can run the display on it.

- Public yasl_loop_*: descriptors, timers and signals. Descriptor
  callbacks return void. Timer IDs are 64 bits and never reused; a zero
  delay runs in the next step. A nested step or run fails with EBUSY, a
  step off the loop's thread with EPERM, and a quit made before a run ends
  it at once. An interrupted wait keeps its deadline. Creating a loop
  fails when it cannot make its wake pipe.
- The display drives the loop through prepare, wait and check hooks
  instead of wrapping its step. Wayland finishes its read before any
  callback runs, so loop callbacks may create surfaces and do roundtrips.
  Readiness (queued events, an owed REFRESH) is derived in the step, so
  the wait never blocks over pending work. A draw that cannot proceed for
  want of a buffer is no longer counted as work.
- yasl_init takes struct yasl_options. With loop and on_event, each step
  delivers events to on_event and yasl_wait_event fails with EBUSY.
  EALREADY only for the same options, EBUSY for others.
- yasl_surface_request_frame: a REFRESH once the window can show a new
  frame, for pacing animation.
- DISPLAY_LOST reports whether the display reconnects. Pull waits still
  fail with ENOTCONN after a final loss.
- Events pushed from another thread wake the loop.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Fix Cocoa backend focus, close, live resize, popups and notifications</title>
<updated>2026-10-14T11:06:16+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-14T11:05:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=0eec911bdabb130415aeb2fc6eb4281b891a5d2f'/>
<id>urn:sha1:0eec911bdabb130415aeb2fc6eb4281b891a5d2f</id>
<content type='text'>
- Undecorated windows can become key and main; popups never take focus.
- Undecorated windows stay miniaturizable and resizable unless FIXED_SIZE.
- The close button sends a CLOSE request (windowShouldClose:) and does not
  close; the app destroys the surface to comply.
- Refresh runs during live resize: the modal flag is set between
  windowWillStartLiveResize: and windowDidEndLiveResize:, and CPU surfaces
  refresh before the frame is rendered. A destroyed window clears the flag.
- presentsWithTransaction is only changed for CPU presenters.
- Display open and surface creation return EPERM off the main thread.
- Popups are always CPU surfaces with a software queue, also under a Metal
  parent.
- Interactive move and drag start use the recorded mouse-down; without a
  press they set ESTALE. Interactive resize and window menu return ENOTSUP.
- Notifications: ENOTSUP outside an app bundle; one authorization request,
  notifications queued until it is granted, EACCES after a denial.
- Titles use the full string instead of a 159-byte copy that could split a
  UTF-8 sequence.
- finishLaunching runs once per process, not once per display open.

Co-Authored-By: Claude Haiku 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>cocoa: fix</title>
<updated>2026-10-14T09:54:49+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-14T09:53:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=4c91e0213a3e7234c837ec54d6f17f28871fc586'/>
<id>urn:sha1:4c91e0213a3e7234c837ec54d6f17f28871fc586</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove deprecated Cocoa OpenGL and private compatibility APIs</title>
<updated>2026-10-14T06:38:31+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>berke.guzel@gdh.digital</email>
</author>
<published>2026-10-14T06:38:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=5ef6ca21ab9e1cf4f69254234d190a634b777d52'/>
<id>urn:sha1:5ef6ca21ab9e1cf4f69254234d190a634b777d52</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Simplify the public event and CPU API</title>
<updated>2026-10-13T20:41:31+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T20:41:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=76073fe5fad8799e5850805f2f090af2cb62c741'/>
<id>urn:sha1:76073fe5fad8799e5850805f2f090af2cb62c741</id>
<content type='text'>
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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>public api refactor</title>
<updated>2026-10-13T18:23:03+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T18:23:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=dd1775a9927922c14f8679ccbc4d3ca8d5917e20'/>
<id>urn:sha1:dd1775a9927922c14f8679ccbc4d3ca8d5917e20</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Read back the last presented CPU frame</title>
<updated>2026-10-13T14:12:10+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T14:12:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=b7944e4bbfa64a6bb1a1d9e1f172827dde53aed2'/>
<id>urn:sha1:b7944e4bbfa64a6bb1a1d9e1f172827dde53aed2</id>
<content type='text'>
wsap_term writes PNG screenshots for its debug server and keeps its own
copy of the frame because YASL had no readback.

yasl_surface_read_pixels() copies the frame from the last successful
present, or reports its extent when the buffer is too small. X11 and
Cocoa keep it in their single CPU target until the next draw starts;
X11 now also forgets it when a resize replaces the target, and Cocoa
records the presented extent because a resize can change the size before
the next draw. Wayland remembers which buffer it committed and forgets it
when a draw reuses that buffer.

The backend test checks the copy on Wayland and X11, and that draws that
never present do not show through. The Cocoa path is not built or run
here.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Report the system double-click interval</title>
<updated>2026-10-13T14:08:48+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T14:08:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=ac6f9f5e7711521455b83ceb843a25e091646d43'/>
<id>urn:sha1:ac6f9f5e7711521455b83ceb843a25e091646d43</id>
<content type='text'>
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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Add desktop services: open URI, notify, appearance, bell, and paths</title>
<updated>2026-10-13T14:05:59+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T14:05:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=d4d13e616cb15ef22479d9cb97922af93317a01a'/>
<id>urn:sha1:d4d13e616cb15ef22479d9cb97922af93317a01a</id>
<content type='text'>
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 &lt;yasl/desktop.h&gt;.

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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Wake and post to loops from any thread, and watch signals</title>
<updated>2026-10-13T13:55:45+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T13:55:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=efca84e8b5204c4d5ce28113474df0bf0b67dbf3'/>
<id>urn:sha1:efca84e8b5204c4d5ce28113474df0bf0b67dbf3</id>
<content type='text'>
wsap_term runs its own eventfds to wake the loop from its pty worker and
accessibility threads, and its own signalfd or self-pipe per platform.

yasl_loop_kick() is now documented as safe from any thread and from a
signal handler. yasl_loop_post() queues a function to run on the owning
thread during a later step. yasl_loop_watch_signals() installs a
process-wide SA_RESTART handler per signal that records the signal and
kicks the loop, so callbacks run on the loop thread on every platform
without touching thread masks.

Cocoa dispatch waited only for AppKit events, so kicks, posts, and fd
watches could not end an indefinite wait, and yasl_post_event() did not
wake yasl_run(). While waiting, Cocoa now mirrors the loop's descriptors
in a kqueue whose run loop source posts a wake event. If kqueue rejects a
descriptor, the wait is bounded to 10 ms.

The Cocoa change is not built or run here; it needs a macOS check.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
