Skip to content

create window with x y position - #658

Open
mcrgnt wants to merge 1 commit into
not-fl3:masterfrom
mcrgnt:create-window-with-x-y-position
Open

create window with x y position#658
mcrgnt wants to merge 1 commit into
not-fl3:masterfrom
mcrgnt:create-window-with-x-y-position

Conversation

@mcrgnt

@mcrgnt mcrgnt commented Aug 8, 2026

Copy link
Copy Markdown

Summary

Add optional Conf.window_x / Conf.window_y applied at window creation, so desktop apps can restore geometry without a visible jump after map.

None (default) keeps current platform / WM placement.

Motivation

set_window_position after the window is shown races with WM placement on X11 (and similar on other desktops). Games usually do not care; desktop clients that persist window prefs do. Create-time coordinates + WM size hints avoid that race.

Platform matrix

Backend Behavior
Windows CreateWindowEx uses coords when Some, else CW_USEDEFAULT
Linux X11 XCreateWindow + USPosition/PPosition hints when Some
macOS setFrameTopLeftPoint when both Some, else center
Wayland Ignored (compositor owns placement); one-line stderr note
WASM / Android / iOS Ignored

API

pub window_x: Option<u32>,
pub window_y: Option<u32>,

Screen coordinates, top-left origin (same convention as set_window_position).

Notes

  • Wayland cannot portably set absolute toplevel position; documenting ignore is intentional.
  • Happy to adjust naming / docs if maintainers prefer a single Option<(u32, u32)>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant