mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-27 17:14:40 +01:00
Merge branch 'hidpi-ppi-fix' into 'develop'
Fix zathura not rendering on hidpi displays See merge request pwmt/zathura!55
This commit is contained in:
commit
3a6fea5bb9
1 changed files with 4 additions and 2 deletions
|
@ -173,10 +173,12 @@ zathura_update_view_ppi(zathura_t* zathura)
|
||||||
GdkRectangle monitor_geom;
|
GdkRectangle monitor_geom;
|
||||||
gdk_monitor_get_geometry(monitor, &monitor_geom);
|
gdk_monitor_get_geometry(monitor, &monitor_geom);
|
||||||
|
|
||||||
/* calculate ppi, knowing that 1 inch = 25.4 mm */
|
/* Due to a bug in Gtk, width is sometimes incorrectly reported to be 1mm
|
||||||
if (width_mm == 0) {
|
* see https://gitlab.gnome.org/GNOME/gtk/issues/3115 for details */
|
||||||
|
if (width_mm <= 1) {
|
||||||
girara_debug("cannot calculate PPI: monitor has zero width");
|
girara_debug("cannot calculate PPI: monitor has zero width");
|
||||||
} else {
|
} else {
|
||||||
|
/* calculate ppi, knowing that 1 inch = 25.4 mm */
|
||||||
ppi = monitor_geom.width * 25.4 / width_mm;
|
ppi = monitor_geom.width * 25.4 / width_mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue