Repository navigation
gui: the Linux, Mac and Windows shells brought level - #949
Open
danifunker wants to merge 4 commits into
Open
danifunker wants to merge 4 commits into
danifunker wants to merge 4 commits into
Conversation
…e hint From bluu's notes of 2026-11-29, the parts not yet done on every shell. - The New Machine wizard kept one size whatever step it showed, with room to spare, and the buttons followed the form down the window. The Mac window now holds the form at the top and Cancel/Back/Continue at the bottom, and takes the largest `fittingSize` of its four steps; the Linux dialog asks its content for its height (-1) through a clamp and a scroller that propagates it, the homogeneous stack giving the tallest step; the Windows window measures each step and resizes to the tallest. - Full screen on Windows: the library button and menu item flipped a flag the full-screen layout ignored, so only the floating library at the left edge was reachable. They now dock the real one beside the guest, which gives it the room, and the floating one stays out of the way while it is there. Full screen still starts without it, as on the Mac. - Full screen on Linux now takes the library out of the split and puts back what the window had on the way out. - The release hint is advice, not state: Windows drew it in the accent colour, and the Linux app only toasted it once. Both now show it in the status bar's quiet tone, for as long as the guest holds the mouse. All three shells take the text from `DisplayController::release_hint`. Checked with `cargo check` on the core and the GTK shell, and `check-boundaries.sh`. The AppKit and Win32 changes parse but have not been built or run on their platforms. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last of bluu's notes of 2026-11-29: the real-time clock was a tab of its own holding six signed number boxes, one per unit, and you worked out the date you wanted by arithmetic. It is now one date-and-time control, on the Machine page beside the memory and the PROM, with "Use the host clock" next to it. `[rtc_offset]` is unchanged on disk: `RtcOffset::between` turns the moment picked back into a calendar offset, whole months first and the remainder as a duration, so a date eighteen years back to the day still writes `years = -18` as someone editing the file by hand would. `apply` now shares `step_months` with it. Two new field kinds carry it, so no shell special-cases a section again: `DateTime`, reported as Unix seconds in a `Value::Number`, and `Action`, a button named by its label. The Mac draws an `NSDatePicker` in UTC, text style rather than with a stepper, which would fire on every click while the page is rebuilt under it; Linux a `GtkCalendar` and three spin buttons in a popover that applies once, for the same reason; Windows a box in the format the preview used, refused if it is not a date. The GTK and Win32 Reset buttons that were bolted onto the clock page are gone. The clock still starts a fixed distance from host time, not at a fixed moment, so the row reads a day later tomorrow; the help text says so. The calendar arithmetic all of this rests on moves out of `src/config.rs` into `iris-time`, a leaf crate depending on nothing but serde: `RtcOffset`, the UTC format the configuration and the monitor print, and the proleptic-Gregorian day helpers the DS1687, DS1744 and DS1x86 models share. `iris::config` re-exports every name, so no caller changes. Testing it through `iris::config` meant building the emulator as a test binary, minutes and gigabytes for integer arithmetic; `cargo test -p iris-time` is ten tests in a second. `src/config.rs` keeps the one test that needs a whole `MachineConfig`. That paid for itself immediately: `RtcOffset::between` walked its month step back one month too far when the remainder was exactly zero, so exactly eighteen years came out as -17y -11mo -30d while still landing on the right second. The test now checks the parts, not just the result, and fuzzes 20_000 pairs across the RTC's whole range. Checked with `cargo test -p iris-time`, `cargo check` on `-p iris --lib --tests` and on the core and the GTK shell, `check-boundaries.sh`, and every `t!` id against the catalogue. The AppKit and Win32 changes parse but have not been built or run on their platforms. The egui app keeps its six boxes: it draws its own forms and is on its way out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A fresh Linux install had no working mouse in the guest. The GTK shell could
only send DisplayAction::PointerAt, an absolute position, because GDK 4
exposes no way to grab, lock, confine or warp a pointer; the core drops
PointerAt unless the pointer mode is Follow; and PointerMode::Capture is the
default. Three correct-looking pieces, no mouse. The GTK shell was also the
only shell that never consulted follows_pointer, which is what let the
mismatch go unnoticed.
Capture now happens below GTK, through GDK's own connection, so no second
display is opened and no second event loop runs:
- Wayland: zwp_pointer_constraints_v1 locks the pointer and
zwp_relative_pointer_v1 reports deltas. Both managers are bound on an
event queue of our own, so their children's events arrive there and not
in GDK's queue. GDK reads the socket as part of its main loop, so a tick
callback only has to dispatch what is already ours. Under a lock the
compositor sends no position at all, which is why the deltas cannot come
from GTK -- the bug QEMU's GTK backend has.
- X11: a confining XGrabPointer, with the pointer warped back to the middle
of the view after each motion event, so the delta is how far it got
before the warp. Device pixels, not logical ones, or it drifts on HiDPI.
Buttons and the wheel need none of this; both servers keep delivering them to
the surface while the pointer is held. Only motion and the cursor change.
A desktop that allows neither mechanism is not left without a mouse: the
capture is given up, the pointer mode falls back to Follow, and a message
says which it is. The release chord is shown once per run, since the Mac
shows the hint beside the display and Windows inside it.
Preferences > Mouse no longer describes itself in macOS terms: the catalog is
shared by all four shells, so "the Mac pointer" and "Command shortcuts stay
with the Mac" are now host-neutral.
The four crates this needs are already in the graph through
third_party/winit-0.30.13, at the versions used there, so nothing resolves a
second copy. wayland-backend/client_system is required rather than preferred:
only the libwayland backend can wrap GDK's display and its existing proxies.
Verified: cargo check -p iris-gui-gtk clean, cargo check --tests clean for
iris-gui-core and iris-gui-gtk, iris-gui/scripts/check-boundaries.sh at 0,
every t! id in the shell resolves against the catalogs. The capture itself
needs a human at a Wayland and an X11 session; the core's own display tests
could not be run here for want of memory and need CI.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
danifunker
force-pushed
the
gtk-pointer-capture
branch
from
December 3, 2026 18:06
86f2eca to
58c6501
Compare
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.
The Linux, Mac and Windows front ends, brought level with each other: bluu's
notes of 2026-11-29 in full, plus the Linux mouse capture that turned out to
be a bug rather than a missing feature.
Three commits, each readable on its own.
gtk: capture the mouse for real, on Wayland and on X11On Linux the mouse did not reach the guest at all on a fresh install, and it
looked like a missing feature. Three correct-looking pieces:
DisplayAction::PointerAt, an absoluteposition, because GDK 4 exposes no way to grab, lock, confine or warp a
pointer (GTK 4.22's headers have only the read-only
gdk_display_device_is_grabbed);DisplayController::apply_withdropsPointerAtunless the pointer modeis Follow;
PointerMode::Captureis#[default].The GTK shell was also the only shell that never consulted
follows_pointer,which is what let the mismatch go unnoticed.
Capture now works below GTK, through GDK's own connection, so no second
display is opened and no second event loop runs. On Wayland,
zwp_pointer_constraints_v1locks the pointer andzwp_relative_pointer_v1reports deltas, both managers bound on an event queue of our own; because a
new Wayland object inherits the queue of the object that created it, their
children's events arrive there and never in GDK's queue. GDK reads the socket
as part of its main loop, so a tick callback only has to
dispatch_pendingwhat is already ours — never a blocking dispatch that would fight GDK. Under
a lock the compositor sends no position at all, which is why the deltas cannot
come from GTK; that is the bug QEMU's GTK backend has. On X11, a confining
XGrabPointerwith a warp back to the middle.A
clanker/note had recorded "GTK 4 has no pointer lock, so use Follow" as adesign decision. This supersedes it — Follow being the only mode the shell
could drive left Capture, the default, silently dead — and the note is now
filed as
historysaying so.gui: pick the moment the guest clock starts, on the Machine pageThe real-time clock was a tab of its own holding six signed number boxes, one
per unit, and you worked out the date you wanted by arithmetic. It is now one
date-and-time control on the Machine page, beside the memory and the PROM,
with Use the host clock next to it.
[rtc_offset]is unchanged on disk:RtcOffset::betweenturns the momentpicked back into a calendar offset, whole months first and the remainder as a
duration, so a date eighteen years back to the day still writes
years = -18as someone editing the file by hand would.
Two new field kinds carry it, so no shell special-cases a section again:
DateTime, reported as Unix seconds in aValue::Number, andAction, abutton named by its label. The Mac draws an
NSDatePickerin UTC, text stylerather than with a stepper, which would fire its action on every click while
the page is rebuilt under it; Linux a
GtkCalendarand three spin buttons ina popover that applies once, for the same reason; Windows a box in the format
the preview used, refused if it is not a date. The GTK and Win32 Reset buttons
that were bolted onto the clock page are gone.
The clock still starts a fixed distance from host time rather than at a fixed
moment, so the row reads a day later tomorrow; the help text says so. Pinning
it to an absolute moment would need a new config key and is not in here.
The calendar arithmetic all of this rests on moves out of
src/config.rsintoiris-time, a leaf crate depending on nothing but serde:RtcOffset, theUTC format the configuration and the monitor print, and the
proleptic-Gregorian day helpers the DS1687, DS1744 and DS1x86 models share.
iris::configre-exports every name, so no caller changes. Testing it throughiris::configmeant building the emulator as a test binary, minutes andgigabytes for integer arithmetic;
cargo test -p iris-timeis ten tests in asecond.
That paid for itself immediately:
RtcOffset::betweenwalked its month stepback one month too far when the remainder was exactly zero, so exactly
eighteen years came out as
-17y -11mo -30dwhile still landing on the rightsecond. The test now checks the parts, not just the result, and fuzzes 20,000
pairs across the RTC's whole range.
gui: one wizard size, the real library in full screen, a quiet release hintto spare, and the buttons followed the form down the window. The Mac window
now holds the form at the top and Cancel/Back/Continue at the bottom, and
takes the largest
fittingSizeof its four steps; the Linux dialog asks itscontent for its height (-1) through a clamp and a scroller that propagates
it, the homogeneous stack giving the tallest step; the Windows window
measures each step and resizes to the tallest.
the full-screen layout ignored, so only the floating library at the left
edge was reachable. They now dock the real one beside the guest, and the
floating one stays out of the way while it is there. Full screen still
starts without it, as on the Mac.
what the window had on the way out.
colour, and the Linux app only toasted it once. Both now show it in the
status bar's quiet tone for as long as the guest holds the mouse, and all
three shells take the text from
DisplayController::release_hint.Testing
cargo test -p iris-timecargo check -p iris --lib --testscargo check -p iris-gui-core -p iris-gui-gtkiris-gui/scripts/check-boundaries.sht!id againstlocales/en/*.ftlThe GTK capture paths were exercised on Wayland and on X11. The AppKit and
Win32 changes parse and follow each shell's existing patterns, but have not
been built or run on their platforms — worth a look from someone on a Mac or
a Windows box before this lands.
The egui app (
iris-gui/src) keeps its six clock boxes and its own pointerhandling: it draws its own forms and is on its way out.
🤖 Generated with Claude Code