<feed xmlns='http://www.w3.org/2005/Atom'>
<title>yasl.git/src/platform/x11/window.c, branch one-loop</title>
<subtitle>[no description]</subtitle>
<id>https://git.wsap.dev/yasl.git/atom?h=one-loop</id>
<link rel='self' href='https://git.wsap.dev/yasl.git/atom?h=one-loop'/>
<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>X11: survive server loss, chain X errors, fix popups and pointer requests</title>
<updated>2026-10-14T11:22:39+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-14T11:20:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=2408acfac3acd22dc207d41daed82294de2f3275'/>
<id>urn:sha1:2408acfac3acd22dc207d41daed82294de2f3275</id>
<content type='text'>
- Losing the X server queues DISPLAY_LOST instead of exiting. A process-wide
  IO error handler returns for YASL displays, so Xlib calls the per-display
  exit handler and returns; later waits fail with ENOTCONN, and dispatch and
  flush make no Xlib calls on a lost display.
- Errors on other displays chain to the previous handler, restored when the
  last YASL display closes.
- MIT-SHM attach is synced; a refused attach detaches and falls back to
  XPutImage. Shared images are used only for 32-bit TrueColor 0xAARRGGBB.
- Undecorated windows set MWM_HINTS_DECORATIONS and leave functions alone.
- Fixed-size windows keep their min/max hints in step with set_size.
- Swap interval is stored per surface and applied when it becomes current;
  gl_make_current(NULL) without EGL succeeds as a no-op.
- XInitThreads runs before the first connection.
- Move, resize, window menu, drag start and place-under-pointer need a held
  pointer button (ESTALE). Move and resize also need _NET_WM_MOVERESIZE on
  the root (ENOTSUP) and send the held button.
- _GTK_SHOW_WINDOW_MENU carries the XI2 client pointer and root coordinates.
- Popups always present through CPU and grab the pointer (XI2 device grab
  when available); a press outside every YASL window closes the topmost popup.
- Drag start while active returns EBUSY; drag carry without a drag EINVAL.

Co-Authored-By: Claude Haiku 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>X11: fix ICCCM selections, add INCR and alpha, honor Xft.dpi</title>
<updated>2026-10-14T11:14:21+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-14T11:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=26f644f51709cc9f6cdd8060e7561498f2bb465d'/>
<id>urn:sha1:26f644f51709cc9f6cdd8060e7561498f2bb465d</id>
<content type='text'>
Clipboard and primary selection:
- Take ownership at the time of the latest key or button event instead of
  CurrentTime; TIMESTAMP answers with the time each selection was taken.
- Forget the stored text on SelectionClear.
- Answer MULTIPLE (failed pairs get None) and refuse selections other than
  CLIPBOARD and PRIMARY.
- Send payloads above the request limit with INCR instead of refusing them,
  with a per-chunk timeout and cleanup on display close.
- Receive INCR transfers: delete the marker to start, append chunks on
  PropertyNewValue, and finish on a zero-length chunk.

Translucency:
- CPU toplevels and popups use a 32-bit TrueColor visual with their own
  colormap when the server has one. Shared-memory and plain images use the
  window's visual and depth.

HiDPI:
- Read Xft.dpi at display open and derive the scale, clamped to 1x-4x.
  Logical creation sizes and set_size requests become device pixels, and
  reported geometry carries the scale.

Co-Authored-By: Claude Haiku 5.5 &lt;noreply@anthropic.com&gt;
</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>Reconnect to a restarted Wayland compositor</title>
<updated>2026-10-13T20:52:22+00:00</updated>
<author>
<name>Berke Güzel</name>
<email>wenekar1@gmail.com</email>
</author>
<published>2026-10-13T20:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.wsap.dev/yasl.git/commit/?id=563b23a33726289387193b85d90fb569631ee05f'/>
<id>urn:sha1:563b23a33726289387193b85d90fb569631ee05f</id>
<content type='text'>
Windows now outlive the compositor. On connection loss YASL sends
DISPLAY_LOST instead of closing every window, retries the connection on
a loop timer, rebuilds each toplevel with its title, size, state and GL
context, and sends DISPLAY_RESTORED. CPU windows keep their pixels;
GPU renderers drop Vulkan surfaces and GL objects on loss and rebuild
them on restore.

- Free the dead connection's objects on the next wait, after the
  application has released GPU objects built on them.
- Report a lost connection as an event rather than a failed wait.
- Refuse window and Vulkan surface creation while offline with the new
  YASL_ERROR_DISCONNECTED.
- Close popups, cancel drags and fail pending clipboard requests on loss.
- Print only protocol errors, not ordinary disconnects.
- Examples survive a restart; game.c rebinds its GL context.
- Add an end-to-end test that kills Weston under CPU, GL and Vulkan
  windows and requires them to recover.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</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>
</feed>
