Merge pull request #7647

This commit is contained in:
autocraft-bot[bot]
2026-12-02 07:39:07 +00:00
6 changed files with 44 additions and 1 deletions
+9
View File
@@ -745,6 +745,15 @@ fn main() -> eframe::Result {
}
let spool = Spool::new(host.jobs_shared().clone());
let mut app = WordApp::new(session, services(spool.clone(), intake, nightly)).with_host(host).with_settings(settings.clone());
// Drawn by the processor (WARP, llvmpipe; #2221), animations that follow the system stop.
if let Some(state) = &cc.wgpu_render_state {
let info = state.adapter.get_info();
let software = info.device_type == eframe::wgpu::DeviceType::Cpu;
if software {
log::warn!("graphics: drawing in software on {} ({:?}): animations that follow the system are off", info.name, info.backend);
}
app.set_software_drawing(software);
}
// PLAN: writer note 9 puts `with_settings` after `with_control`; it comes first here because
// the region check below reads the saved region the settings apply.
if std::env::var("WORDCRAFT_FILE_DIALOG").is_ok_and(|v| v.trim().eq_ignore_ascii_case("builtin")) {
+9 -1
View File
@@ -120,6 +120,7 @@ impl WordApp {
control: None,
capture_token: 0,
native_scale: 1.0,
software_drawing: false,
auto_scale_limit: f32::INFINITY,
legacy_interface_size: None,
applied_editing: None,
@@ -214,11 +215,18 @@ impl WordApp {
.wheel_speed(WheelSpeed::new(line, point))
.alt_code_pages(AltCodePages::new(ansi, oem))
.set(ComponentSet::Productivity);
env.motion = self.ui.animations.motion();
env.motion = self.ui.animations.motion_drawn(self.software_drawing);
env.sizes = std::sync::Arc::clone(&APP_SIZES);
env
}
/// The window is drawn by the processor (`on`), as the desktop app finds once it knows the
/// graphics adapter. Animations that follow the system then stop: the caret blinks without
/// fading or gliding, and nothing fades, slides or spins. On in File › Options still animates.
pub fn set_software_drawing(&mut self, on: bool) {
self.software_drawing = on;
}
/// What this frame's mode and motion choices resolve to: the system's answer replaces `System`.
/// Before the first frame there is no context to ask, and the system reports nothing.
pub(crate) fn resolved_root(&self) -> ResolvedRoot {
+5
View File
@@ -458,6 +458,11 @@ pub struct WordApp {
/// The display scale (native pixels per point) seen in the last frame, 1.0 before the first;
/// `ui.interfaceSize` reports the size Auto draws at with it.
native_scale: f32,
/// The window is drawn by the processor, not a graphics card (WARP on Windows, llvmpipe on
/// Linux; #2221): the desktop app sets it once it knows the adapter. Every animated frame is
/// then the whole window drawn in software, so animations that follow the system stop
/// ([`WordApp::set_software_drawing`]).
software_drawing: bool,
/// The most pixels per point Auto may draw at on this screen ([`theme::auto_scale_limit`], #4030).
auto_scale_limit: f32,
/// A pre-#822 interface size (percent on top of the display scale) waiting for the first frame
+14
View File
@@ -221,6 +221,20 @@ fn animation_effects_is_an_accessibility_option() {
assert_eq!(system_help(&h), None, "only said while the system is followed");
}
/// #2221: a window drawn by the processor stops the animations that follow the system; On still plays.
#[test]
fn software_drawing_stops_animations_that_follow_the_system() {
use crate::theme::Animations;
use craft::behavior::MotionMode;
let mut a = app();
assert_eq!(a.ui.animations, Animations::System);
assert_ne!(a.resolved_root().motion, MotionMode::Off, "a graphics card animates");
a.set_software_drawing(true);
assert_eq!(a.resolved_root().motion, MotionMode::Off);
a.ui.animations = Animations::On;
assert_eq!(a.resolved_root().motion, MotionMode::Full, "the person's own choice stands");
}
/// #838: in a Polish region lengths read `2,54 cm` (the region's unit and decimal comma).
#[test]
fn length_fields_follow_the_region() {
+6
View File
@@ -231,6 +231,12 @@ impl Animations {
}
}
/// [`Self::motion`] for a window drawn by the processor when `software`: `System` is then no
/// motion at all, since every animated frame is the whole window drawn in software (#2221).
pub fn motion_drawn(self, software: bool) -> MotionChoice {
if software && self == Animations::System { MotionChoice::Off } else { self.motion() }
}
/// The runtime's motion choice: `System` is the OS's reduced-motion answer, else full motion.
pub fn motion(self) -> MotionChoice {
match self {
+1
View File
@@ -168,6 +168,7 @@ impl WordApp {
ime_origin: _,
user_origin: _,
native_scale: _,
software_drawing: _,
auto_scale_limit: _,
legacy_interface_size: _,
applied_editing: _,