Repository navigation
Conversation
- Every Wayland session but GNOME now uses SDL's Wayland driver. On niri, sway and similar, sdl2-compat picked X11, which went through xwayland-satellite and made the UI take seconds per click. - app_events defers redraws until the event queue is empty. Drawing and waiting for vsync on every mouse move let a fast mouse queue up seconds of redraws ahead of a click. - Text is rasterized by stb_truetype (third_party/stb, v1.26) at the exact pixel size it lands on screen, from DejaVu Sans / Bold subset to ASCII and embedded (24 KB), with a glyph cache, quarter-pixel positions and kerning. This replaces the 32/56 px atlas that was bilinear-scaled 3-4x down and came out jagged. font_dejavu.h goes from 188 KB to 69 KB. - Rounded rects, pills and knobs are anti-aliased geometry (SDL_RenderGeometry); the gear and pin icons are rasterized at their pixel size. This replaces the 96 px disc/icon textures scaled down. - Packaging scripts ship stb_truetype's licence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks! The coalesced redraws are a clear win. One blocker: SDL_RenderGetWindow (menu.h unit_xform) needs SDL 2.0.22, so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On niri (Wayland, 1920x1080 at scale 1) the desktop viewer took around 4 s from a click to the settings drawer opening, and its text and rounded UI looked jagged. This fixes both.
Responsiveness
SDL_VIDEODRIVER/SFT_VIDEO_DRIVER/--video-driverstill wins, and the existing fallback stays in place.app_eventsredrew the home screen or drawer, and waited for vsync, on every event, mouse moves included. A high-polling-rate mouse queued up seconds of presents ahead of a click:app_eventsmeasured up to 2.3 s per call. Redraws requested while handling events now set a flag and run once after the queue is empty, which brought the worst case to 4.5 ms. During a Win32 live resize (g_in_size_move) it still draws immediately.Crisp text and shapes
The UI drew everything from bitmaps made at one size and bilinear-scaled: a 32/56 px font atlas drawn at 11–20 px, and a 96 px disc and icons drawn at radius 4–20 px. At 3–8× minification that skips texels and comes out jagged.
third_party/stb, MIT or public domain) at the exact on-screen pixel size, from DejaVu Sans and Bold subset to ASCII and embedded (24 KB). Glyphs are cached, placed at quarter-pixel positions, kerned, and copied texel for texel. The size is computed in device pixels, so the scaled stats overlay and HiDPI windows stay sharp.font_dejavu.hgoes from 188 KB to 69 KB, andgen_font.pynow only subsets and embeds the fonts.SDL_RenderGeometry, a 1 px fading edge) at any size.text_draw/text_width/ui_rrectsignatures are unchanged, so callers didn't change.licenses/.Testing
--shotat 1896×1031 and 838×628 (0.85 UI density).tools/sft_stream_test.py: raw-view decoded all 40 packets with the expected single lost frame. The PyAV check couldn't run here (noavmodule).🤖 Generated with Claude Code