Inform layer surfaces of scale/transform changes
Browse files at this commitbb044075fab6181747fc7d3b648c6fcd9b5b760fParent: 370fd4e1 changed file +12 -2
- src/niri.rs +12 -2
src/niri.rsmodified+12 -2
| @@ -2157,9 +2157,20 @@ impl Niri { | |||
| 2157 | 2157 | ||
| 2158 | pub fn output_resized(&mut self, output: &Output) { | 2158 | pub fn output_resized(&mut self, output: &Output) { |
| 2159 | let output_size = output_size(output).to_i32_round(); | 2159 | let output_size = output_size(output).to_i32_round(); |
| 2160 | + let scale = output.current_scale(); | ||
| 2161 | + let transform = output.current_transform(); | ||
| 2160 | let is_locked = self.is_locked(); | 2162 | let is_locked = self.is_locked(); |
| 2161 | 2163 | ||
| 2162 | - layer_map_for_output(output).arrange(); | 2164 | + { |
| 2165 | + let mut layer_map = layer_map_for_output(output); | ||
| 2166 | + layer_map.arrange(); | ||
| 2167 | + for layer in layer_map.layers() { | ||
| 2168 | + layer.with_surfaces(|surface, data| { | ||
| 2169 | + send_scale_transform(surface, data, scale, transform); | ||
| 2170 | + }); | ||
| 2171 | + } | ||
| 2172 | + } | ||
| 2173 | + | ||
| 2163 | self.layout.update_output_size(output); | 2174 | self.layout.update_output_size(output); |
| 2164 | 2175 | ||
| 2165 | if let Some(state) = self.output_state.get_mut(output) { | 2176 | if let Some(state) = self.output_state.get_mut(output) { |
| @@ -2175,7 +2186,6 @@ impl Niri { | |||
| 2175 | 2186 | ||
| 2176 | // If the output size changed with an open screenshot UI, close the screenshot UI. | 2187 | // If the output size changed with an open screenshot UI, close the screenshot UI. |
| 2177 | if let Some((old_size, old_scale, old_transform)) = self.screenshot_ui.output_size(output) { | 2188 | if let Some((old_size, old_scale, old_transform)) = self.screenshot_ui.output_size(output) { |
| 2178 | - let transform = output.current_transform(); | ||
| 2179 | let output_mode = output.current_mode().unwrap(); | 2189 | let output_mode = output.current_mode().unwrap(); |
| 2180 | let size = transform.transform_size(output_mode.size); | 2190 | let size = transform.transform_size(output_mode.size); |
| 2181 | let scale = output.current_scale().fractional_scale(); | 2191 | let scale = output.current_scale().fractional_scale(); |