After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753621 - Calculate screen physical size
Calculate screen physical size
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-08-14 11:53 UTC by Carlos Garnacho
Modified: 2015-08-16 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: calculate screen physical size (2.26 KB, patch)
2015-08-14 11:55 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2015-08-14 11:53:13 UTC
I'm attaching a (very simple) patch to calculate the physical size of the GdkScreen, this makes gdk_screen_get_width/height_mm work, I found evince size/scale calculations to depend on it, this patch is enough to make evince able to zoom in/out (and find out that touchpad gestures just work there, yay).

The implementation might be more complex though, it doesn't account for monitors covering overlapping areas, and I see this breaking for >3 monitors arranged as a grid. It IMO covers most common usecases though, should we maybe try to be smarter from the start anyway?
Comment 1 Carlos Garnacho 2015-08-14 11:55:02 UTC
Created attachment 309256 [details] [review]
wayland: calculate screen physical size

A simple calculation is done so far (assuming monitor areas never overlap)
so gdk_screen_get_width/height_mm return meaningful values.
Comment 2 Matthias Clasen 2015-08-14 13:00:39 UTC
We should probably make this api limp along like your patch does, but it would be good to consider deprecating it and make evince use monitor dimensions instead of screen dimensions. Because in the wayland world, we don't really have screens.
Comment 3 Matthias Clasen 2015-08-16 02:21:18 UTC
Attachment 309256 [details] pushed as 02f3fe0 - wayland: calculate screen physical size
Comment 4 Carlos Garnacho 2015-08-16 10:35:23 UTC
Just filed bug #753675 to evince so that's not lost.