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 747903 - gdk_screen_get_width_mm always returns 0 on Wayland
gdk_screen_get_width_mm always returns 0 on Wayland
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-04-15 10:52 UTC by bugs
Modified: 2016-04-18 16:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bugs 2015-04-15 10:52:16 UTC
The physical size of the monitor is exposed by the physical_width/physical_height of the geometry event of each wl_output, already in millimeters.

This breaks Gajim’s gtk3 port, making it divide by zero.
Comment 1 Matthias Clasen 2015-04-17 01:36:05 UTC
Should be fixed in 3.16.2, I think
Comment 2 bugs 2015-05-14 13:19:57 UTC
On 3.16.3 I can still reproduce that bug.

Possibly related is this warning when I import Gdk from gi.repository:
(.:26349): Gdk-CRITICAL **: gdk_screen_get_monitor_scale_factor: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed
Comment 3 nick 2015-06-26 12:56:49 UTC
i confirm that that this bug still exists.

i get below when i launched web(epiphany) on WESTON.it sometimes works but

sometimes segfaults. 

(WebKitWebProcess:653): Gdk-CRITICAL **: gdk_screen_get_monitor_scale_factor: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed

my weston.ini file(snipped):

[core]
backend=drm-backend.so

[output]
name=LVDS1
mode=1366x768 

1366x768 native res for my laptop.

ENV: gtk-3.16.4 mesa-10.6.0 wayland-1.8.1 weston-1.8.0

GPU: intel ivybridge onboard

Thanks for fix.
Comment 4 nick 2015-06-26 13:04:49 UTC
Above log happens even it works.
Comment 5 Matthias Clasen 2015-07-28 05:16:16 UTC
Works correctly in 3.17
Comment 6 nick 2015-07-28 15:35:26 UTC
(In reply to Matthias Clasen from comment #5)
> Works correctly in 3.17

i confirmed too.thanks for fix.
Comment 7 Carlos Alberto Lopez Perez 2016-04-18 16:12:41 UTC
Some more info

The warning:
Gdk-CRITICAL **: gdk_screen_get_monitor_scale_factor: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed

has been fixed in 3.17.2, specifically with commit 62b858c
3.16.x remains affected.