Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.50.0] - 2026-10-04

### Added
- `window_bounds(w)` returns a window's placement: its size, and its position where the platform reports one (none on Wayland). While the window is maximized, fullscreen or borderless, or after it closes, it returns what leaving that state restores, so an app can save it on close in any mode (#318).
- `window_set_bounds(w, placement)` moves and resizes a windowed window, or sets what leaving fullscreen or borderless returns to (#318).
- `window_open_placed(placement, title, mode)` opens a window at a saved placement and straight into its mode, with no windowed frame first. `Config.position` carries a placement through `context_init` (#318).

### Fixed
- `Window.windowed` held stale bounds while the window was windowed. It is now kept current (#318).
- A saved position off every monitor is clamped onto the monitor it overlaps most, or centred when it overlaps none (#318).

## [0.49.0] - 2026-10-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion mach.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
id = "boom"
version = "0.49.0"
version = "0.50.0"
mach = "^6.10.1"
src = "src"
out = "out/{target.name}/{profile.name}"
Expand Down
12 changes: 10 additions & 2 deletions src/context.mach
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ use boom.window;
use boom.window.Window;
use boom.window.WindowError;
use boom.window.WindowMode;
use boom.window.WindowPlacement;
use boom.window.WindowPosition;
use boom.window.window_close;
use boom.window.window_error_message;
use boom.window.window_open_mode;
use boom.window.window_open_placed;
use boom.window.window_set_event_sink;
use std.chrono.duration.Duration;
use io_error: std.io.error;
Expand All @@ -46,6 +48,8 @@ use std.types.string.str;
# frame_dt: when non-zero, the delta every frame is told it took, instead of
# the wall clock. See below.
# mode: initial window presentation mode
# position: windowed client origin to restore, none to centre on the primary
# monitor. ignored where the platform withholds placement (wayland)
#
# WHY A GAME WOULD PIN ITS FRAME DELTA. The loop feeds the wall-clock delta into
# the fixed-step accumulator, so the number of ticks a run executes depends on
Expand All @@ -68,6 +72,7 @@ pub rec Config {
max_frame: Duration;
frame_dt: Duration;
mode: WindowMode;
position: opt[WindowPosition];
}

# whether a configuration can drive the frame loop
Expand Down Expand Up @@ -174,7 +179,10 @@ pub fun context_init(ctx: *Context, cfg: Config) err[ContextError] {

ctx.events = queue_new();
ctx.input = inp.input_new();
val opened: res[Window, WindowError] = window_open_mode(cfg.width, cfg.height, cfg.title, cfg.mode);
val placement: WindowPlacement = WindowPlacement{
position: cfg.position, width: cfg.width, height: cfg.height,
};
val opened: res[Window, WindowError] = window_open_placed(placement, cfg.title, cfg.mode);
if (sel opened.err) { ret err[ContextError].err{ContextError.window{opened.err}}; }
ctx.window = opened.ok;
# the sink lives in the Context so it outlives the window, which the
Expand Down
Loading
Loading