[gnome-desktop] gnome-rr: Document the default DPI setting



commit e9dee9d73b92e7c0d7c81104d8284a9915f96292
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 20 16:52:35 2012 +0100

    gnome-rr: Document the default DPI setting
    
    As X.org lies to us because the monitors lie to it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=545112

 libgnome-desktop/gnome-rr-config.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 3e80e38..37bd2a9 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -44,6 +44,11 @@
 #define CONFIG_INTENDED_BASENAME "monitors.xml"
 #define CONFIG_BACKUP_BASENAME "monitors.xml.backup"
 
+/* Look for DPI_FALLBACK in:
+ * http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/xsettings/gsd-xsettings-manager.c
+ * for the reasoning */
+#define DPI_FALLBACK 96.0
+
 /* In version 0 of the config file format, we had several <configuration>
  * toplevel elements and no explicit version number.  So, the filed looked
  * like
@@ -1924,8 +1929,8 @@ crtc_assignment_apply (CrtcAssignment *assign, guint32 timestamp, GError **error
      *
      * Firefox and Evince apparently believe what X tells them.
      */
-    width_mm = (width / 96.0) * 25.4 + 0.5;
-    height_mm = (height / 96.0) * 25.4 + 0.5;
+    width_mm = (width / DPI_FALLBACK) * 25.4 + 0.5;
+    height_mm = (height / DPI_FALLBACK) * 25.4 + 0.5;
 
     if (success)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]