image/rendering: Use new GdkMonitor geometry units

The bug that the geometry isn't returned in app pixels on wayland
without scale-monitor-framebuffer was fixed in GDK. Therefore also
require newer GTK version.
This commit is contained in:
Sophie Herold 2024-02-11 15:47:38 +01:00
parent 1c20570c0e
commit 14e5d03a1e
2 changed files with 5 additions and 14 deletions

View file

@ -313,20 +313,11 @@ impl imp::LpImage {
if let Some(monitor) = display.monitor_at_surface(&surface) {
let hidpi_scale = self.scaling();
let monitor_geometry = monitor.geometry();
let monitor_size = (
monitor_geometry.width() as f64,
monitor_geometry.height() as f64,
);
// Assume scale-monitor-framebuffer disabled for non-fractional scaling
// <https://gitlab.gnome.org/GNOME/gtk/-/issues/5391>
let physical_geometry = if hidpi_scale == obj.scale_factor() as f64 {
monitor_size
} else {
(monitor_size.0 * hidpi_scale, monitor_size.1 * hidpi_scale)
};
return Some(physical_geometry);
return Some((
monitor_geometry.width() as f64 * hidpi_scale,
monitor_geometry.height() as f64 * hidpi_scale,
));
}
}
}