From 43afd1d41a0c4e5624371c01cfd384fb076183c2 Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 1 Dec 2026 10:56:27 +0100 Subject: [PATCH] Headless contexts get no desktop services (craft-libs d3a4e159 reports held buttons on Windows) The new craft-libs pin makes SystemWindows report the physical mouse buttons on Windows. Integration tests build ui-egui without cfg(test), so their scripted presses ended as lost releases. Same change as in #18632. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/app/framework.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/app/framework.rs b/crates/ui-egui/src/app/framework.rs index a428e02eac..744e8358f8 100644 --- a/crates/ui-egui/src/app/framework.rs +++ b/crates/ui-egui/src/app/framework.rs @@ -30,12 +30,13 @@ use craft::ui::runtime::install::WheelModifiers; use craft::ui::runtime::{InstallError, InstallSpec}; use craft::ui::shell::embed; use craft::window::policy::Decision; -// Tests run headless: the desktop pointer Windows tells is the mouse of the machine running them, not the test's -// pointer, so tests see no desktop services on any platform, as on Linux. +// Tests run headless: the desktop pointer and mouse buttons Windows tells are those of the machine running them, not +// the test's, so tests see no desktop services on any platform, as on Linux. #[cfg(test)] use craft::window::system::NoWindows as Desktop; #[cfg(not(test))] use craft::window::system::SystemWindows as Desktop; +use craft::window::system::{NoWindows, WindowSystem}; use photocraft_engine::Session; use photocraft_engine::prefs::{AppearanceMode, Preferences, UiDensity}; use serde_json::Value; @@ -69,7 +70,11 @@ pub(crate) fn install(ctx: &egui::Context, fonts: &UiFonts<'_>, frame: Option = if frame.is_some() { Arc::new(Desktop) } else { Arc::new(NoWindows) }; + let mut spec = InstallSpec::new(ShellInfo::default().backend(Backend::from_env()), desktop) .wheel(wheel) .app_id(crate::os_window::app_id()) .system(SystemReader::start(move || wake.request_repaint()));