[f21/master] Handle 0's returned by Gdk

David Shea dshea at redhat.com
Wed Sep 24 19:24:39 UTC 2014


Sometimes gdk doesn't know how big a monitor is. This should not make us
crash.
---
 pyanaconda/ui/gui/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 656051b..df98360 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -522,6 +522,10 @@ class GraphicalUserInterface(UserInterface):
         monitor_width_mm = screen.get_monitor_width_mm(primary)
         monitor_height_mm = screen.get_monitor_height_mm(primary)
 
+        # Sometimes gdk returns 0 for physical widths and heights
+        if monitor_height_mm == 0 or monitor_width_mm == 0:
+            return
+
         # Check if this monitor is high DPI, using heuristics from gnome-settings-dpi.
         # If the monitor has a height >= 1200 pixels and a resolution > 192 dpi in both
         # x and y directions, apply a scaling factor of 2 so that anaconda isn't all tiny
-- 
2.1.0



More information about the anaconda-patches mailing list