Skip to content

gui_toolkit 0.373.0

Choose a tag to compare

@sachahjkl sachahjkl released this 02 Dec 14:28
· 130 commits to master since this release
v0.373.0
5414a6d

Added

  • platform.is_window_occluded and process.warm_defender: Windows now detects hidden, minimized, DWM-cloaked, and z-order-covered windows via SetWinEventHook and an exact opaque rectangle-union check so gt:host pauses animations while covered and wakes immediately when uncovered; process.warm_defender warms Windows Defender's image scan cache on newly installed or updated binaries off the interface thread (CREATE_SUSPENDED | CREATE_NO_WINDOW).
  • The compressed Direct3D 12 runtime inside the program: the Agility SDK's D3D12Core.dll is compressed with gt:flate into every Windows program, verified by SHA-256 on warm starts without decompressing, and extracted and flushed once to %LOCALAPPDATA%\gui_toolkit\d3d12; no DLL stands beside the program. render.d3d12_runtime() says which runtime made the device.
  • The first frame on the CPU and the device at rest on Windows (Direct3D 12): a window shows its first picture before its device is made (platform.show_pixels: a layered popup over the client area, translucent windows included), about 70 ms sooner on WARP; a program whose windows are all hidden lets its device go (render.rest, host's Shared.rest_after), and its textures, heaps and settings come back with the next frame.
  • Vulkan on Windows: a program built with -define:TOOLKIT_RENDER=vulkan draws its Win32 windows with the toolkit's Vulkan
    renderer (opaque windows: they keep their GDI surface, platform.gdi_presents()), on a graphics card's driver or on Mesa's lavapipe.
    render.vulkan_can_draw says whether a Vulkan device can draw, without making one, for a program that picks its renderer when it
    starts.
  • draw.Text_Mark, Context.text_marks: a test reads the size on the target (pixels per em), the pen and the glyph count of each text run drawn in a frame, whether its glyphs come from Slug outlines, the glyph cache or the font's bitmaps. Off by default (nil).
  • ui.flow's items: where an item of its own size sits in the height of its line (.Start, .Center by default,
    .End), so cards of different heights line up their titles.
  • Tabs reordered by dragging (Tabs_Options.reorder, in ui.tabs_ex and a tab_panel): a tab held and dragged along its strip takes another place while the others slide out of its way, tabs of different widths included; the strip scrolls when the tab reaches its edge, Escape puts it back, Ctrl+Shift+Left and Right move the focused tab. Tabs_Result.moved (ui.Tab_Move) gives {from, to} when the tab is let go, and selected is already the chosen tab's index after the move. A click still only chooses. With it: ui.strip_nudge, ui.reorder_index_after, ui.reorder_cancel, ui.reorder_dragged, ui.reorder_released.
  • Curved and freehand arrows in the mark editor: a selected arrow has a round handle at its middle; drag it to bend
    the arrow through that point (Shift: a symmetric arc; a double click: straight again). The Arrow tool's bar offers a
    freehand path: the arrow follows the pointer, its path simplified and smoothed at the release, its head along its end.
    Both are moved, nudged, undone, hit along their curve and flattened into the picture as drawn.
  • Colour picker looks and stepping in a colour's text: ui.color_picker takes a look (Color_Picker_Look): the square
    as before, a wheel (a disc of hue and saturation, ui.hue_sat_picker, with a brightness bar), and a pro look whose
    model switch (RGB, HSL, HSV, OKLCH) gives a track and a number per component, each track the colour across its
    component (ui.color_bar). The picker keeps the recent colours a program marks as used (ui.color_pick_keep) and
    shows them as swatches. In a colour's text, Up and Down step the component at the caret, by its own unit and in its
    range, a hue wrapping and a hex pair stepping as a byte (ui.line_edit_color_step, ui.color_step_text); the
    picker's field does it in every look. A dragged number's field (ui.drag_number) has the theme's control corners, and the picker's format switch shows
    "OKLCH" whole. Every part of the picker (the square, the bars, the swatches) shows the exact colour of each place,
    mixed in sRGB values as CSS mixes it; mixed in linear light it came out lighter.
  • The Vulkan backend's remaining calls: render.video_convert draws video pictures (I420, NV12,
    and 10-bit planes where the device samples them), application shaders draw from their SPIR-V (App_Shader_Desc.spirv, written by
    tools/shaders app beside the DXBC), render.set_gpu_timing and render.set_gpu_profile measure the GPU, a window draws with the
    depth pass, render.rest lets the device go, and the pipelines compiled are kept in ~/.cache/gui_toolkit/vulkan for the next start.
  • Vulkan windows: a program draws into its Wayland and X11 windows, a second window and the device made early included. A frame
    of a region names its rectangles to the compositor (render.present_regions_supported, render.present_rects_sent), so that only
    they are composed again. tk desktop_tests runs the window tests on it, under the validation layer.
  • A program whose windows are all hidden lets its graphics device go: after 30 s with no window shown (host.Shared.rest_after; negative: never), the renderer releases its device, adapter, instance and surfaces, and NVIDIA's Linux driver stops waking the process about 220 times a second. Showing a window makes the device again on a thread; the window's first frame takes it. host.rest rests at once; render.rest, render.wake, render.resting and render.has_device are the renderer's, and platform.wait_deadline_set gives the thread's waits the deadline that counts the time. Linux only for now.
  • A Vulkan 1.3 renderer of the toolkit's own: Linux's renderer (Windows' with -define:TOOLKIT_RENDER=vulkan) draws
    textures, layers, filters, Slug text, pictures, read-back and capture with the same shaders, as SPIR-V written ahead of time.
    TOOLKIT_VULKAN_VALIDATION=1 turns on the validation layer, whose messages fail a test; tools/run_tests runs every Linux test
    on lavapipe with it.

Changed

  • render.canvas_read_cancel(r, rd) takes the renderer: on Direct3D 12 the read-back's buffer goes once the GPU has written it.
  • Windows draws with Direct3D 12 and falls back to Vulkan at runtime: the default Windows build (TOOLKIT_RENDER=auto; d3d12 and vulkan stay available as single-backend overrides) probes Direct3D 12 Shader Model 6.9 on display-driving hardware adapters first and switches to Vulkan before opening the first window (platform.set_gdi_presents(true)) when an older driver lacks Shader Model 6.9 and Vulkan 1.3 is available. Direct3D 12 keeps partial redraw, DirectComposition (translucent windows, under_children, fixed_size), the frame latency object, video planes, application shaders, GPU times, pipeline cache, device recovery and the 2D canvas.
  • Docked views have one head: a view alone and a stack of tabs side by side now have the same bar: the same height,
    the same hairline along the bottom, the same small words on one baseline, and the same controls (Minimise, Maximise,
    the menu and Close) at the right. A view alone shows its title; several show compact tabs. Float, Open in a window
    and Re-attach are in the "…" menu, no longer icons on the strip. The lone view's grip is gone: drag its title.
    • Tabs_Options.compact and tabs_over(style, sf, compact): the same compact tabs for a program's own strip.
  • software names the software device: render.init_offscreen(software = true), render.preload_device(software = true) and
    Renderer.software replace warp: WARP on Direct3D 12, lavapipe on Vulkan. A Linux machine with no driver for its graphics card
    draws with lavapipe, which the package the no-graphics sentence names installs; there is no OpenGL fallback.
  • Shaders in Bento. The renderer's shaders are written in Bento and compiled ahead of time by Shokado to SPIR-V (Vulkan) and DXIL (Direct3D 12), one blob per entry point: naga and DXC are gone. An application shader is now a Bento module app that exports shade (docs/shaders.md): App_Shader_Desc takes bento, spirv, dxil and hash, and odin run tools/shaders -- app <name> <file.bento> <dir> writes its .spv, .dxil and .sha256.
  • Docked views wear the view's controls and meet edge to edge: a stack's tab strip ends with the small controls a
    lone panel's header has (Minimise, Maximise or Restore, the view's menu "…", Close), never the window's caption
    buttons, which stay a window's own title bar's. The handles between zones and stacks are their hairline alone: two
    docked views, or a view and the content, are one line apart with no band between them. The showcase's Views page is
    edge to edge.
  • A program's tests draw on lavapipe: the toolbox's test command gives the tests Mesa's software Vulkan driver unless they have it already, as a tool's program session does. A machine with no graphics driver of its own runs the window tests, and a person's machine keeps its graphics card out of them.

Removed

  • Direct3D 11 and WGSL: the Direct3D 11 renderer (TOOLKIT_RENDER=d3d11, USE_D3D11), the WGSL shaders, their HLSL and DXBC, and tk build_naga are gone. Shaders are Bento only, compiled by Shokado.
  • WebGPU (wgpu-native): Linux draws with the toolkit's Vulkan renderer alone, and no program builds or ships wgpu-native
    any more (nor its licence in THIRD-PARTY-NOTICES). Gone with it: -define:TOOLKIT_RENDER=wgpu, render.USE_WGPU, the
    OpenGL fallback and TOOLKIT_WGPU_BACKEND, TOOLKIT_WGPU_TRACE (TOOLKIT_RENDER_TRACE stays), TOOLKIT_WGPU_DX12_COMPILER,
    render.image_wrap_splits_batches and Batch.image_wrap, tk fetch_wgpu and its DXC download, tools/run_tests's
    -backend and -group, tk desktop_tests -backend, and toolbox.check_env (toolbox.odin_check checks another system's
    code on Odin's own root: its root parameter goes).

Fixed

  • Windows install and update handoff: installed and updated executables, console launchers, and thumbnail DLLs flush via FlushFileBuffers before close/rename; setup.launch, deferred uninstall cleanup, and elevated install helpers keep their working directory outside the install folder so future update renames are not blocked; setup.launch strips installer-only __COMPAT_LAYER=DetectorsAppHealth while keeping user compatibility layers; update.updater_stop closes and removes any in-flight <exe>.update write cleanly before process exit without blocking update.status on disk I/O.
  • Windows AltGr, mixed-DPI moves, modal drag cleanup, and capture pacing: AltGr on European keyboard layouts no longer reports Ctrl+Alt or steals typed symbols (@, €, {, }, [, ], ~, \) as shortcuts while genuine Ctrl+Alt chords keep working; fullscreen WM_DPICHANGED and move_to_active_monitor scale cleanly across mixed-DPI monitors; TIMER_MODAL_FRAME is always disarmed on window destruction; active Windows capture streams scope timeBeginPeriod(1) / timeEndPeriod(1) so sub-16 ms frame pacing sleeps do not quantize to 15.6 ms.
  • platform.wait_deadline, Wayland scale on re-show, retained text slots, and marks curves: wait_deadline tracks
    multiple callers per thread, runs during blocking poll_events, and avoids busy-spinning when a frame is in progress;
    Wayland re-guesses DPI scale when a hidden window is shown again; retained pictures avoid stale loops at non-unit
    raster_scale, snap .Atlas slot glyphs consistently, preserve LCD fallback rendering, and invalidate rotated LCD
    replays; gt:marks omits derived arrow curves from undo snapshots and avoids duplicate vertices in polyline_trim.
  • Colour picker layers and text stepping: opaque hue bars, component bars, and swatches draw directly in sRGB
    interpolation without allocating per-frame offscreen render targets; ui.color_step_text handles CSS Color 4 "none"
    components, signed scientific exponents, and delta == 0.
  • render.Kept_Texture, ui.Open_With, ui.Thumb_Cache, ui.logo, and setup.logo_make: releasing or switching
    a Kept_Texture after its renderer is freed no longer reads freed memory, and dimension or renderer changes recreate
    the texture; ui.Open_With detaches cleanly across owner switches and ui.destroy; Windows "Open with" runs on a
    dedicated STA thread with the parent window; Linux refuses setting a default for application/octet-stream and clears
    [Removed Associations]; Thumb_Cache checks renderer identity before drawing; ui.logo selects the closest native
    size; setup.logo_make frees its pixels when texture creation fails.
  • Overlays, flush splitters, and tab reordering: a flush splitter no longer steals clicks or hover through a modal,
    menu, or popup above it; keyboard tab reordering keeps focus, Tab stops, and accessibility selection in sync; a lifted
    tab stays before the strip's trailing controls, clears when removed, and suppresses clicks if the tab count changes
    mid-drag.
  • Vulkan renderer stability, synchronization, and multi-window safety: wait on prior present/acquire fences before signalling present semaphores, destroy retired swap chains before their VkSurfaceKHR, isolate per-window present counters and capture buffers across device teardown and rest, move pipeline cache disk I/O off the interface thread, retire destroyed application-shader pipelines and in-flight capture buffers through deferred garbage, remove the 256-draw limit on application shaders, gate Win32 overlay redirection surfaces on GDI_PRESENTS, and fix validation flushing, GPU profiling timestamps, create_video_target during the CPU stage, and vulkan_can_draw capability checks.
  • The first frame on Wayland at the screen's fractional scale: a window no longer starts at the screen's whole-number scale and then shrinks or grows a moment later (a 4K screen at 1.875 drew the first frame at 2). Before the compositor says its scale, a window takes the scale of the screen it most likely appears on: the one the compositor names, else the one of the program's window under the pointer or with the keyboard, else the last scale the compositor gave a window.
  • The showcase's terminals show their lines again: the Views scene drew its terminals' and its output's lines in no
    face since Paper Mono became the default monospace face; they use ui.mono_font().
  • Vulkan with an older loader: a device whose loader offers only the EXT surface maintenance extension takes the EXT swapchain
    maintenance one too; it took the KHR one, which the validation layer refused (seen with LunarG's 1.4.309 loader on Windows).
  • A replayed picture draws its small text as direct drawing does again: small text in a slot that only moves it (a column, a scrolled box, a sticky box) now draws from the glyph cache, as the same text drawn directly does; it drew from its outlines, a fraction of a pixel apart (up to 112 of 255 on an edge). A slot that turns or scales, or comes back to a plain move, makes the picture stale: recorded again, its text takes the path direct drawing takes. A glyph drawn from its outline while the frame's cache budget is spent sits at the pen its cached glyph will have.
  • A field keeps its size when it takes the focus, in the machined finish: a sunken field (a text field, a time or
    duration field, a number, a hotkey field, a wheel's drum) drew its focus ring on its own edge and dropped the lit rim
    around it, so it looked a pixel smaller on each side while focused (two at a scale of 1.875). The accent ring now takes
    the rim's place, outside the edge: the outline does not move.
  • A window hidden before its graphics device came no longer crashes: on Wayland an overlay (or any window) hidden while its first frames were drawn on the CPU and shown again made its swap chain on the surface the hide had destroyed. It now waits for the window to come back, and starts on its new surface.
  • A time or duration field no longer moves when its drums open: in ui.parts_field and ui.duration_field, the
    part the keys change lost its size once the field had the keyboard, so the parts shifted and the active one grew to the
    field's height. The parts now keep their place and size, open or closed.
  • A chosen colour swatch is seen at once, and its edge is clean: ui.swatch_button draws one colour of a row to
    choose from (the showcase's and fidget's toolbars, the mark editor's colours and fills). The chosen one has a ring of the
    text's colour outside it, with a gap, in every theme; it keeps its size, so the row does not move. The colour no longer
    shows a rim outside the swatch's edge.
  • Finish details: a number's − and + no longer touch its field (each part keeps a small gap, so a hovered button's edge no longer runs into the field's); a slider's round knob draws its ring as a disc under its white face, with no white edge outside the ring; a selected row too square and round for its lit top line (a rail's icon) no longer shows a short dash in its middle; a node's header sits inside its plate's edge, which now runs unbroken round the node; a node's focus ring and the edge of a link in the emphasis pass under its ports, not over them; the graph's minimap cuts the view's frame to its round corners; a colour swatch's checker follows its round corners; a toolbar's control folded into its "…" menu lights the letters a search found, as an item does.
  • Pictures no longer disappear after the graphics device is recovered: the program's logo, a menu's icons, the setup's marks, the file picker's preview, the mark editor's picture and blurred copies, the thumbnails and the picture cache upload their pixels again (or ask for them again) when the device is new. render.Kept_Texture (kept_texture, kept_release) does it for a program's own texture whose pixels it keeps.
  • ui.Open_With: a file of a type no application declares has a way to open. The applications of
    application/octet-stream come last for every file, and "Choose an application…" always ends the list. On Linux
    the chooser lists every application (desktop.applications) with a search and "Always use for this type"
    (desktop.set_default_handler, the person's mimeapps.list); on Windows desktop.open_with_dialog shows the system's
    dialog. The State builds the chooser at the end of its build: a program calls nothing more. The application chosen
    opens the file (open_with_run), or goes to the program's on_chosen.
  • A program's logo is sharp in the title bar. A logo picture within a quarter of the box's size is drawn at its own pixels, centred, instead of resampled: a 32 px picture in a 17 px box, or a 16 px one at 125 %, no longer blurs.