Hardcode winit transform for now
Browse files at this commit2e50f8dee0f877f8192d04cc2c910fd9efe8451bParent: 7052f012 changed files +11 -4
- src/backend/winit.rs +1 -2
- src/niri.rs +10 -2
src/backend/winit.rsmodified+1 -2
| @@ -16,7 +16,6 @@ use smithay::reexports::calloop::LoopHandle; | |||
| 16 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; | 16 | use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; |
| 17 | use smithay::reexports::winit::dpi::LogicalSize; | 17 | use smithay::reexports::winit::dpi::LogicalSize; |
| 18 | use smithay::reexports::winit::window::WindowBuilder; | 18 | use smithay::reexports::winit::window::WindowBuilder; |
| 19 | -use smithay::utils::Transform; | ||
| 20 | 19 | ||
| 21 | use super::RenderResult; | 20 | use super::RenderResult; |
| 22 | use crate::niri::{RedrawState, State}; | 21 | use crate::niri::{RedrawState, State}; |
| @@ -54,7 +53,7 @@ impl Winit { | |||
| 54 | size: backend.window_size(), | 53 | size: backend.window_size(), |
| 55 | refresh: 60_000, | 54 | refresh: 60_000, |
| 56 | }; | 55 | }; |
| 57 | - output.change_current_state(Some(mode), Some(Transform::Flipped180), None, None); | 56 | + output.change_current_state(Some(mode), None, None, None); |
| 58 | output.set_preferred(mode); | 57 | output.set_preferred(mode); |
| 59 | 58 | ||
| 60 | let physical_properties = output.physical_properties(); | 59 | let physical_properties = output.physical_properties(); |
src/niri.rsmodified+10 -2
| @@ -654,9 +654,13 @@ impl State { | |||
| 654 | let scale = config.map(|c| c.scale).unwrap_or(1.); | 654 | let scale = config.map(|c| c.scale).unwrap_or(1.); |
| 655 | let scale = scale.clamp(1., 10.).ceil() as i32; | 655 | let scale = scale.clamp(1., 10.).ceil() as i32; |
| 656 | 656 | ||
| 657 | - let transform = config | 657 | + let mut transform = config |
| 658 | .map(|c| c.transform.into()) | 658 | .map(|c| c.transform.into()) |
| 659 | .unwrap_or(Transform::Normal); | 659 | .unwrap_or(Transform::Normal); |
| 660 | + // FIXME: fix winit damage on other transforms. | ||
| 661 | + if name == "winit" { | ||
| 662 | + transform = Transform::Flipped180; | ||
| 663 | + } | ||
| 660 | 664 | ||
| 661 | if output.current_scale().integer_scale() != scale | 665 | if output.current_scale().integer_scale() != scale |
| 662 | || output.current_transform() != transform | 666 | || output.current_transform() != transform |
| @@ -1179,7 +1183,11 @@ impl Niri { | |||
| 1179 | let c = config.outputs.iter().find(|o| o.name == name); | 1183 | let c = config.outputs.iter().find(|o| o.name == name); |
| 1180 | let scale = c.map(|c| c.scale).unwrap_or(1.); | 1184 | let scale = c.map(|c| c.scale).unwrap_or(1.); |
| 1181 | let scale = scale.clamp(1., 10.).ceil() as i32; | 1185 | let scale = scale.clamp(1., 10.).ceil() as i32; |
| 1182 | - let transform = c.map(|c| c.transform.into()).unwrap_or(Transform::Normal); | 1186 | + let mut transform = c.map(|c| c.transform.into()).unwrap_or(Transform::Normal); |
| 1187 | + // FIXME: fix winit damage on other transforms. | ||
| 1188 | + if name == "winit" { | ||
| 1189 | + transform = Transform::Flipped180; | ||
| 1190 | + } | ||
| 1183 | drop(config); | 1191 | drop(config); |
| 1184 | 1192 | ||
| 1185 | // Set scale and transform before adding to the layout since that will read the output size. | 1193 | // Set scale and transform before adding to the layout since that will read the output size. |