From 155f8d20d051719a1ae445f037c5f507c5e2bd4f Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 10 Apr 2025 19:42:48 +0200 Subject: [PATCH] xwayland: Honor primary output for fractional scale --- src/xwayland.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/xwayland.rs b/src/xwayland.rs index 8835fdf5..6539b7d9 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -569,10 +569,16 @@ impl Common { } XwaylandDescaling::Fractional => { let shell = self.shell.read().unwrap(); - shell - .outputs() - .map(|o| o.current_scale().fractional_scale()) - .fold(1f64, |acc, val| acc.max(val)) + let val = + if let Some(output) = shell.outputs().find(|o| o.config().xwayland_primary) { + output.current_scale().fractional_scale().max(1f64) + } else { + shell + .outputs() + .map(|o| o.current_scale().fractional_scale()) + .fold(1f64, |acc, val| acc.max(val)) + }; + val } }; @@ -1143,6 +1149,7 @@ impl XwmHandler for State { output_name.as_deref().is_some_and(|o| o == output.name()); } self.common.output_configuration_state.update(); + self.common.update_xwayland_scale(); self.common .config .write_outputs(self.common.output_configuration_state.outputs());