AtlatestRepositorysigil-desktop
sigil-desktop / treeCHANGELOG.md
1
# Changelog3
Versions are synced with Sigil releases. A missing entry indicates no changes for that version.5
All notable changes to this project will be documented in this file.7
The format is based on [Keep a Changelog](https://keepachangelog.com/),8
and this project adheres to [Semantic Versioning](https://semver.org/).10
## [Unreleased]12
## [0.14.0] - 2026-09-2614
### Added16
- `(window-focused?)`: `#t` while the window has the input focus, `#f`17
when another window has it (and `#f` without a window), read from GLFW18
at the call (`GLFW_FOCUSED`). A program polls it once a frame to pause19
when the player switches away. On Wayland it is `#f` until the20
compositor's keyboard-enter arrives (often a frame or two after the21
window opens), so pause on `#f` only after a first `#t`.22
`test/test-window.sgl` covers the23
no-window answer; `test/test-focus-live.sgl` (Xvfb, xdotool) gives the24
window the focus, moves it to the root window and gives it back, and was25
seen red with a planted defect.27
## [0.13.0] - 2026-09-2529
### Added31
- `(window-width)` and `(window-height)`: the window's size in screen32
units, the units `window-set-size!` takes, read from GLFW at the call33
(`#f` without a window). `frame-width` / `window-width` is the device34
pixel ratio, so a program sizing its window to whole multiples of a35
pixel-art view can ask for the right size on a scaled output (HiDPI36
Wayland, a Retina Mac). Without them a program could not snap its37
window to whole scales on a scaled output at all.38
`test/test-window.sgl` and `test/test-window-live.sgl` cover both, the39
live test seen red with a planted defect.41
## [0.12.0] - 2026-09-2543
### Added45
- **Cursor capture for mouse look.** `(set-cursor-captured! on?46
[escape-releases?])` hides the cursor and holds it on the window47
(GLFW's disabled cursor mode, plus raw mouse motion where the platform48
has it); it answers whether the cursor is now captured, and49
`(cursor-captured?)` says so later, both read from GLFW's input mode (a50
platform that cannot capture answers `#f`). Losing the window focus always51
releases the capture, and Escape does too unless `escape-releases?` is52
`#f`, so a player is never left with a hidden cursor; the Escape key53
still reaches the game.54
- `(mouse-dx)` and `(mouse-dy)`: the mouse's motion since the last frame55
in framebuffer pixels, summed from the cursor callback and cleared with56
the other per-frame input. A capture change re-reads the position, so57
starting or ending a capture adds no jump and drops no motion; the58
position reported as the pointer enters the window is not counted.59
- `test/test-cursor-live.sgl`: drives all of it with xdotool on a60
headless X server (see its header).62
## [0.11.0] - 2026-09-2464
### Added66
- **The window: its size, fullscreen, the monitor.** Wanted by Harkfell67
(ruling D37, David, 2026-09-24: a Knytt-style small window at whole scales68
of the view, and fullscreen at the largest whole scale that fits).69
- `(window-set-size! width height)` asks for a window of that size in70
screen units (on a scaled Wayland output the framebuffer is that times71
the scale). While fullscreen it sets the size the window comes back to.72
A tiling window manager may not grant it: read `frame-width` and73
`frame-height` after.74
- `(set-fullscreen! on?)` makes the window take the whole of the monitor75
it covers most of, at that monitor's own video mode (no mode change),76
keeping its windowed size and position (the position where the platform77
reports one: Wayland does not, and the compositor places the window when78
it comes back); `#f` goes back to them. `(fullscreen?)` answers which.79
- `(monitor-size)` answers `(width height)` of that monitor's video mode.80
On Wayland, which reports no window position, "the monitor the window81
covers most of" is the primary monitor, for `set-fullscreen!` too.82
- Without a window, all four answer `#f` (`test/test-window.sgl`); with83
one, `test/test-window-live.sgl` drives them on a display (Xvfb).85
## [0.10.2] - 2026-09-2187
### Added89
- **The mouse wheel.** `(mouse-wheel)` answers the wheel's vertical travel90
since the last frame and `(mouse-wheel-x)` the horizontal, in GLFW's91
units (a notch is 1.0 on most mice; vertical + is away from the user),92
summed over the frame from GLFW's scroll callback and cleared with the93
other per-frame input. Without a window both answer 0.0. Wanted by Crash94
The Stack's tracker (the wheel scrolls the pattern; David, 2026-09-21).96
## [0.10.1] - 2026-09-2098
### Added100
- **The rest of the keyboard.** `key-down?`, `key-pressed?` and101
`key-released?` now know `f1`..`f25`, `page-up`/`page-down`, `home`/`end`,102
`insert`/`delete`, `right-shift`/`right-ctrl`/`right-alt`, `caps-lock`,103
the punctuation row (`comma` `period` `slash` `semicolon` `apostrophe`104
`minus` `equal` `left-bracket` `right-bracket` `backslash` `grave`, or the105
character itself as a symbol) and the keypad (`kp-0`..`kp-9`, `kp-enter`,106
`kp-add`, `kp-subtract`). The 0.10.0 names are unchanged. Wanted by107
Crash The Stack's tracker, whose FastTracker key model needs the108
function keys, paging and the punctuation row natively.109
- `(key-code key)`: the GLFW key code a symbol names, or `#f` for a name110
that is no key; needs no window, so a program can check a binding111
before it is used and the symbol table is testable (`test/test-keys.sgl`).113
## [0.10.0] - 2026-09-20115
The package is now **sigil-desktop**, and the window is GLFW instead of116
sokol_app.118
### Changed120
- **Native Wayland on Linux.** GLFW 3.5.1 is vendored as source under121
`vendor/glfw` (no local patches, `VENDOR.md` has the pin and inventory).122
One binary runs as a Wayland client or under X11, picked at startup;123
`SIGIL_DESKTOP_PLATFORM=wayland|x11` forces it. Under sokol_app the124
Linux window was always X11 (XWayland on a Wayland desktop).125
- **No platform libraries linked.** GLFW loads libwayland-client,126
libxkbcommon, libX11 and friends, libEGL and libGL at run time; the127
Linux `link-flags` are empty (were `-lX11 -lXi -lXcursor`). A game's128
NEEDED list loses those three.129
- **Framebuffer pixels follow the output scale.** On a Wayland output at130
scale 2 a window asked for at 800x600 has a 1600x1200 framebuffer;131
`frame-width`/`frame-height` report it and `mouse-x`/`mouse-y` are in the132
same pixels. Fractional scales work. A program with hard-coded pixel133
coordinates should lay out from `frame-width` and `frame-height`. On X11134
nothing changes.135
- The library is `(sigil desktop)`. `(sigil app)` remains as a re-export136
for this release only.137
- `app-run` raises `app-run: could not open a window` (exit 1) when no138
display platform or GL context is available; sokol_app aborted.139
- `(quit-requested?)` answers `#t` inside the frame the close button was140
pressed in, not only in cleanup.141
- The frame clock restarts after the init procedure, so a long asset load142
is not the first frame's delta time.143
- GL 4.3 core is requested on Linux and Windows and 4.1 on macOS, as144
before; the window has no default icon (sokol_app drew one).146
### Added148
- `include/sigil-desktop.h`: `sigil_desktop_framebuffer_size`,149
`sigil_desktop_gl_get_proc_address`, `sigil_desktop_platform`, the C150
surface sigil-graphics builds its swapchain and GL loader on.151
- `src/c/dl-search.c`: a `dlopen` that finds runtime libraries in Guix and152
Nix profile directories (`SIGIL_LIBRARY_PATH`, `$GUIX_ENVIRONMENT/lib`,153
nix-shell inputs, `$NIX_LD_LIBRARY_PATH`, the user and system profiles),154
with `test/dl-search-test.sh`.155
- `guix/run-wayland.scm`, `guix/run-x11.scm`, `guix/build.scm`.156
- `SIGIL_DESKTOP_VERBOSE=1` for startup, resize and library-resolution157
diagnostics.159
### Removed161
- `vendor/sokol` (sokol_app, sokol_time, sokol_log) and the `sapp_*`162
symbols. sigil-graphics 0.11.4 no longer links them.164
### Requires166
- Sigil 0.20+ as before. Building on Guix needs the X11 and Wayland headers167
in `guix/build.scm` (libx11, libxcursor, libxrandr, libxinerama, libxi,168
libxext, xorgproto, wayland, libxkbcommon).170
### Upgrade notes172
- **Relock at the new URL.** The Codeberg repository is173
`sigil/sigil-desktop` since 2026-09-20 (renamed in place, the old URL174
redirects): write `(from-git url: "codeberg:sigil/sigil-desktop"175
version: "^0.10.0")` on your own window dependency line. The176
transitional form the tag notes describe,177
`(from-git url: "codeberg:sigil/sigil-app" name: "sigil-desktop" ...)`,178
still works through the redirect; a line with neither the new URL nor179
`name:` beside a sigil-graphics 0.11.4 installs the repository twice180
(`sigil-app` 0.9 beside `sigil-desktop` 0.10, two window stacks, a181
duplicate `slog_func` at link time), because sigil-build keys a182
dependency by the name it derives from the URL.183
- Delete the consumer's `build/` once (a stale `sokol-app.o` otherwise184
stays in the old archive), then rename `(sigil app)` imports to185
`(sigil desktop)` before 0.11.187
## [0.9.0] - 2026-06-25189
### Changed191
- Raised the toolchain requirement to Sigil 0.17. The package now192
declares `sigil: "^0.17"` and pins `sigil-stdlib` to `^0.17`. Sigil193
0.17 makes the package-level `sigil:` field mandatory and derives the194
native codegen runtime (`sigil-lib`) from it, so building under the195
0.17 compiler requires this bump. This is a minor release because196
consumers caret-pinning sigil-app must move to the 0.17 line.198
### Requires200
- Sigil 0.17+ (`sigil-stdlib` / `sigil-lib` 0.17 line).202
## [0.8.4] - 2026-04-24204
### Fixed206
- `link-flags:` now uses `(lambda (ctx) (case (target-os ctx) ...))`207
instead of a host-based `(case (host-os) ...)` expression. The208
host-based form evaluated at package-load time on the host, so209
Linux link flags (`-lX11 -lXi -lXcursor`) leaked into Windows210
cross-compile builds; `sigil build --config windows-amd64` from a211
Linux host would fail at the final link against zig's MinGW212
sysroot. The procedural form re-evaluates at link time with the213
target triple. Branches themselves are unchanged (`linux`:214
`-lX11 -lXi -lXcursor`; `darwin`: `-framework Cocoa -framework215
QuartzCore`; `windows`: `-lkernel32 -luser32 -lshell32 -lgdi32`).217
### Requires219
- `sigil-build` 0.14.0+ (for the `target-os` / `target-arch` helpers220
and the procedural-link-flags dispatch in `collect-native-link-flags`).222
## [0.7.0] - 2026-03-01224
### Added226
- Added procedure specifications with inline (: ...) syntax, optional runtime checking via sigil-checks feature, and predicate combinators (any-of, maybe, list-of, none-of).227
- Added procedure specs and docstrings to all exported procedures.228
- Added procedure specs and docstrings to all exported procedures.230
## [0.5.0] - 2026-02-17232
### Added234
- Added test harness generation and build support for packages with native dependencies. Improved native package handling, added c-flags field to library struct. Fixed stdlib inclusion in bundles with custom native runtimes, directory structure preservation in compile-c-sources, and absolute sigil-lib include path resolution.235
- Added test coverage.236
- Added test coverage.238
### Fixed240
- Fixed random seed initialization crash caused by flonum-to-bignum promotion in modulo. Fixed status command crash when displaying projected versions for packages without changes.242
### Other244
- New packages split from sigil-studio. Font and image modules moved to (sigil graphics *) namespace.