From c5b1c34cbca77dd5777c1422557e19b610a4890c Mon Sep 17 00:00:00 2001 From: Phoebus Date: Thu, 1 Oct 2026 17:39:22 -0700 Subject: [PATCH] fix(desktop): enlarge Settings and align QEMU pointer --- docs/CHANGELOG.md | 17 ++++++++++---- docs/DEVELOPMENT.md | 7 +++--- docs/HANDOFF.md | 21 +++++++++++++++--- docs/STATUS.md | 13 +++++++++-- docs/VIRTUAL-MACHINES.md | 22 ++++++++++++------- .../crates/phoebus-core/src/system.rs | 4 ++++ installer/tests/vm/launch-interactive.py | 4 +++- installer/tests/vm/run-vm.sh | 12 ++++++---- 8 files changed, 75 insertions(+), 25 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 155e593..4742241 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,14 @@ this file is the curated, human-readable summary. ## Unreleased — Fast defaults with user-controlled source builds +- **Settings size and VM pointer alignment (2026-10-01).** DMS Settings now + opens at 900×700 on new Mango profiles. The interactive QEMU launcher uses + unscaled 2D VirtIO output and an absolute USB tablet by default after both + GTK and SDL VirGL viewers on the host showed image scaling with offset + clicks. VirGL remains available through `--graphics gl`. The existing + disposable VM confirmed the larger Settings window and an aligned click on + its close control; a fresh install is still pending the host space gate. + - **Desktop wallpapers (2026-10-01).** Four original, offline 16:9 wallpapers now ship with the installer and live desktop: desert dusk, aurora lagoon, carved stone and misty lake. Installation seeds the current user's @@ -16,11 +24,12 @@ this file is the curated, human-readable summary. and Mesa video targets, and enables their applicable services. Mango gains `wlr-randr`, a corrected low-resolution check, a preferred-mode change watcher and the session agents for SPICE/VirtualBox channels. The - interactive QEMU launcher selects VirGL when the host can run it and + interactive QEMU launcher can select VirGL when requested and provides a guest-agent port. The visible playground was restarted with - VirGL (`+virgl`) and displayed the desktop. GTK window zoom works; native - guest resolution change on GTK resize and VMware/VirtualBox sessions remain - unverified. A concurrent assistant handshake test now uses the same + VirGL (`+virgl`) and displayed the desktop. GTK GL window scaling later + proved to offset clicks on this host; native guest resolution change on GTK + resize and VMware/VirtualBox sessions remain unverified. A concurrent + assistant handshake test now uses the same personal-storage environment lock as the state-writing tests, eliminating a full-suite race found during verification. See `docs/VIRTUAL-MACHINES.md`. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index b3ecd2f..fbf96ca 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -74,9 +74,10 @@ DISK=/tmp/phoebus/target.qcow2 OVMF_CODE=... OVMF_VARS=... \ python3 installer/tests/vm/serial-driver.py boot ``` -`installer/tests/vm/run-vm.sh` launches an interactive VM instead. It selects -VirGL automatically when a writable host render node is available; use -`--graphics 2d` for compatibility or `--graphics gl` to require acceleration. +`installer/tests/vm/run-vm.sh` launches an interactive VM instead. Its default +VirtIO display uses an absolute USB tablet and unscaled GTK output so visible +controls line up with clicks. Use `--graphics gl` to request VirGL acceleration; +some QEMU GL viewers have a cursor offset, so use `--graphics 2d` if that occurs. Guest package selection and the limits of window resize are described in `docs/VIRTUAL-MACHINES.md`. diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 7c162be..4426152 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -3,6 +3,20 @@ Rolling note between work sessions. **Update this file before you finish**, then commit it. It should be short and current; use `git log` for detail. +- **Settings and pointer (2026-10-01):** The DMS Settings window was only + about 500×400 because Mango floated it at its minimum size. A specific + 900×700 Settings rule was added to the packaged Mango config and checked in + the existing disposable QEMU VM. On this host, both GTK and SDL VirGL viewers + displayed a 1680×1050 guest frame smaller than the viewport while clicks + followed full-size coordinates. The VM was relaunched with 2D VirtIO, GTK + zoom off and a USB tablet; the image filled the window and clicking the + visible Settings close icon closed it. `run-vm.sh` now chooses this reliable + input path by default; `--graphics gl` remains opt-in. The VM is left running + on the existing disposable qcow2 for the user. Rust format, warning-free + Clippy, workspace tests, release and static builds, VM safety tests, + ShellCheck and Python syntax checks pass. A fresh ISO/install could not + be exercised because `make doctor` found 10 GiB free against its 20 GiB gate. + - **Wallpaper defaults (2026-10-01):** Four generated 1672 × 941 JPEGs live in `installer-rs/assets/wallpapers`. The installer embeds and seeds them for the installation user and future accounts without replacing custom files; @@ -23,10 +37,11 @@ commit it. It should be short and current; use `git log` for detail. relevant units. Gentoo's QEMU agent starts by udev when its port appears, so it is not enabled as a static unit. Mango installs `wlr-randr`, fixes its low-resolution check, watches changed preferred modes, and starts available - SPICE/VirtualBox session agents. The disposable QEMU launcher selects VirGL - when the host has a render node and exposes a QEMU guest-agent port. + SPICE/VirtualBox session agents. The disposable QEMU launcher can select + VirGL when explicitly requested and exposes a QEMU guest-agent port. Portage dependency previews resolved all three package stacks. The current - QEMU GTK window zooms on resize without changing the guest preferred mode; + QEMU GTK GL window scaled on resize without changing the guest preferred mode + and later showed pointer drift; VMware/VirtualBox runtime behavior, SPICE window resize and a fresh installed ISO are unverified. Rust format, warning-free Clippy, workspace tests, release and static builds, VM safety tests, and ShellCheck pass. diff --git a/docs/STATUS.md b/docs/STATUS.md index 071fca2..9a2801a 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -60,11 +60,20 @@ Virtual-machine integration: QEMU/KVM, VMware and VirtualBox detection, hypervisor-specific guest packages, Mesa video targets, system services and Mango display helpers are implemented and unit-tested. The current visible QEMU VM booted with `virtio-vga-gl`, logged in, and reported `+virgl`; the -`wlr-randr` package was installed and inspected there. GTK scales the guest -view on host window resize, but guest resolution did not follow that resize. +`wlr-randr` package was installed and inspected there. On this host the GL +viewer scaled the guest image incorrectly and offset clicks; the 2D VM path +aligned the visible image and pointer. Guest resolution did not follow GTK +window resize in the VirGL run. VMware and VirtualBox integration is Portage-previewed but **not VM verified**. See `docs/VIRTUAL-MACHINES.md`. +Desktop usability (2026-10-01): Mango's default DMS Settings rule now opens a +900×700 window; a 2D QEMU playground verified this size and a correctly aligned +click on its close icon. The GTK and SDL VirGL viewers on this host shrank the +rendered image and offset pointer clicks, so the interactive VM launcher now +defaults to unscaled 2D plus a USB tablet. VirGL remains an explicit option. +A fresh install with these defaults is not yet verified. + | Area | Implemented | Unit tested | VM verified | Hardware verified | |------|-------------|-------------|-------------|-------------------| | Config (TOML + legacy), validation | yes | yes | yes | n/a | diff --git a/docs/VIRTUAL-MACHINES.md b/docs/VIRTUAL-MACHINES.md index 5bb8d75..d2fe843 100644 --- a/docs/VIRTUAL-MACHINES.md +++ b/docs/VIRTUAL-MACHINES.md @@ -9,7 +9,7 @@ the host disables it. | Host | Phoebus install selection | Host graphics setting | Resize path | |---|---|---|---| -| QEMU/KVM | `qemu-guest-agent`, `spice-vdagent`, Mesa `virgl`, `wlr-randr` | VirtIO GPU with VirGL and a GL-capable display; the Phoebus `run-vm.sh` chooses `virtio-vga-gl` automatically when the host has a usable render node | GTK scales the visible guest image to the window. For guest resolution changes, provide a SPICE vdagent channel and a client that sends display configuration (for example virt-viewer). | +| QEMU/KVM | `qemu-guest-agent`, `spice-vdagent`, Mesa `virgl`, `wlr-randr` | VirtIO GPU; the interactive launcher defaults to 2D with aligned pointer input and offers VirGL through `--graphics gl` | For guest resolution changes, provide a SPICE vdagent channel and a client that sends display configuration (for example virt-viewer). | | VMware | `open-vm-tools` with `resolutionkms`, Mesa `vmware`, `wlr-randr` | Enable the VMware accelerated graphics adapter in VM settings | `vmtoolsd` plus the virtual DRM driver's preferred-mode events; Phoebus applies a newly advertised preferred mode in Mango. | | VirtualBox | Guest Additions with `gui`, Mesa `vmware` for the VMSVGA adapter, `wlr-randr` | Select VMSVGA and enable 3D acceleration if the host supports it | Guest Additions service and `VBoxClient-all` in the Mango session; Phoebus also applies a newly advertised preferred mode. | @@ -19,19 +19,25 @@ If DMS has written an output configuration, Phoebus leaves it alone. The existing low-VGA boot promotion now checks the `wlr-randr` output correctly. `run-vm.sh --graphics auto` is the default for the disposable interactive -QEMU launcher. `--graphics gl` requires VirGL; `--graphics 2d` is an explicit -compatibility choice. The launcher uses `virtio-vga` variants so the UEFI and -LUKS prompt remain visible. It also provides a QEMU guest-agent virtio port; +QEMU launcher and chooses the aligned 2D path. `--graphics gl` requires VirGL; +the GL viewers tested here scaled the picture without scaling pointer input, +causing clicks to drift farther from the cursor toward the lower right. Similar +problems are tracked in QEMU's [GTK](https://gitlab.com/qemu-project/qemu/-/issues/761) +and [SDL](https://gitlab.com/qemu-project/qemu/-/issues/2447) issue reports. The +launcher uses `virtio-vga` variants so the UEFI and LUKS prompt remain visible, +and attaches an absolute USB tablet. It also provides a QEMU guest-agent virtio port; Gentoo's udev rule starts the otherwise static guest-agent unit when that port appears. ## Verification boundary The visible QEMU playground booted and reached Mango + DarkMaterialShell with -`virtio-vga-gl`; the guest kernel reported `+virgl`. In this VM, GTK window -resizing scaled the guest image, but did not change the guest's advertised -preferred mode. The QEMU resize watcher therefore cannot claim guest -resolution changes through this GTK setup. The new `wlr-randr` package was +`virtio-vga-gl`; the guest kernel reported `+virgl`. The host's GTK and SDL GL +viewers both shrank a 1680×1050 guest image and offset clicks. Relaunching the +same qcow2 with 2D VirtIO, GTK zoom disabled and an absolute tablet filled the +window; a click on the visible Settings close icon closed that window. The QEMU +resize watcher cannot claim guest resolution changes through the tested GTK +setup. The new `wlr-randr` package was installed and its output inspected in this disposable VM. Portage dependency previews resolved the QEMU, VMware and VirtualBox package atoms. VMware and VirtualBox guest sessions, 3D rendering and resize events still require tests diff --git a/installer-rs/crates/phoebus-core/src/system.rs b/installer-rs/crates/phoebus-core/src/system.rs index 911483b..f2a20b6 100644 --- a/installer-rs/crates/phoebus-core/src/system.rs +++ b/installer-rs/crates/phoebus-core/src/system.rs @@ -1637,6 +1637,7 @@ tagrule=id:9,layout_name:tile layerrule=noanim:1,layer_name:^dms windowrule=isfloating:1,appid:^com.danklinux.dms$ +windowrule=width:900,height:700,appid:^com.danklinux.dms$,title:^Settings$ windowrule=isfullscreen:1,title:^Install Phoebus OS$ # =========================================================================== @@ -2984,6 +2985,9 @@ mod tests { assert!(config.contains("tag,1,0")); assert!(config.contains("setlayout,tile")); assert!(config.contains("togglefloating,")); + assert!(config.contains( + "windowrule=width:900,height:700,appid:^com.danklinux.dms$,title:^Settings$" + )); let (name, entry) = wayland_session_entry(DesktopProfile::Mango).unwrap(); assert_eq!(name, "phoebus-mango.desktop"); diff --git a/installer/tests/vm/launch-interactive.py b/installer/tests/vm/launch-interactive.py index 215176b..8f5f8ef 100755 --- a/installer/tests/vm/launch-interactive.py +++ b/installer/tests/vm/launch-interactive.py @@ -45,7 +45,9 @@ cmd = [ "-drive", f"file={ISO},media=cdrom,readonly=on", "-boot", "order=d", "-device", "virtio-vga", - "-display", "gtk,zoom-to-fit=on", + "-device", "qemu-xhci", + "-device", "usb-tablet", + "-display", "gtk,zoom-to-fit=off", "-netdev", "user,id=n0", "-device", "virtio-net-pci,netdev=n0", "-device", "virtio-rng-pci", diff --git a/installer/tests/vm/run-vm.sh b/installer/tests/vm/run-vm.sh index 2245387..6f17429 100755 --- a/installer/tests/vm/run-vm.sh +++ b/installer/tests/vm/run-vm.sh @@ -35,7 +35,7 @@ Options: --mem MiB RAM in MiB (default 4096) --cpus N vCPUs (default 4) --display OPT QEMU display (default gtk; use none for headless) - --graphics MODE auto (default), gl, or 2d; GTK auto uses VirGL when available + --graphics MODE auto (default), gl, or 2d; auto uses aligned 2D input --disk-boot Boot from the scratch disk instead of the ISO --help Show this help @@ -97,7 +97,10 @@ if [[ ! -f "$DISK" ]]; then fi VIDEO_DEVICE="virtio-vga" -if [[ "$DISPLAY_OPT" == gtk* && "$GRAPHICS" != 2d ]]; then +if [[ "$DISPLAY_OPT" == gtk* && "$DISPLAY_OPT" != *zoom-to-fit=* ]]; then + DISPLAY_OPT="${DISPLAY_OPT},zoom-to-fit=off" +fi +if [[ "$GRAPHICS" == gl && "$DISPLAY_OPT" == gtk* ]]; then render_node=false for node in /dev/dri/renderD*; do if [[ -r "$node" && -w "$node" ]]; then render_node=true; break; fi @@ -113,8 +116,8 @@ if [[ "$DISPLAY_OPT" == gtk* && "$GRAPHICS" != 2d ]]; then if [[ "$render_node" == true && "$gl_probe" == true ]] \ && qemu-system-x86_64 -device help | grep 'name "virtio-vga-gl"' >/dev/null; then VIDEO_DEVICE="virtio-vga-gl" - DISPLAY_OPT="${DISPLAY_OPT},gl=on,zoom-to-fit=on" - elif [[ "$GRAPHICS" == gl ]]; then + DISPLAY_OPT="${DISPLAY_OPT},gl=on" + else echo "error: VirGL requires a writable DRM render node and working host EGL/VirGL" >&2 exit 1 fi @@ -161,6 +164,7 @@ QEMU=(qemu-system-x86_64 -drive file="$DISK",if=virtio,format=qcow2 -netdev user,id=n0 -device virtio-net-pci,netdev=n0 -device "$VIDEO_DEVICE" + -device qemu-xhci -device usb-tablet -chardev socket,id=qga,path="$WORKDIR/qga.sock",server=on,wait=off -device virtio-serial-pci -device virtserialport,chardev=qga,name=org.qemu.guest_agent.0