[gnome-initial-setup/shell/4765: 152/362] display: hide page when using VGA or not on an HD resolution



commit 6257b3ab3f24dd59580f72e9905dbe0f19b1d448
Author: Cosimo Cecchi <cosimo endlessm com>
Date:   Tue Aug 12 10:27:29 2014 -0700

    display: hide page when using VGA or not on an HD resolution
    
    Overscan is not needed in those cases.
    
    [endlessm/eos-shell#3370]

 .../pages/display/gis-display-page.c               |   23 ++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/pages/display/gis-display-page.c 
b/gnome-initial-setup/pages/display/gis-display-page.c
index 36b1b55..41b84b2 100644
--- a/gnome-initial-setup/pages/display/gis-display-page.c
+++ b/gnome-initial-setup/pages/display/gis-display-page.c
@@ -118,6 +118,23 @@ toggle_overscan (GisDisplayPage *page)
     }
 }
 
+static gboolean
+should_display_overscan (GisDisplayPage *page)
+{
+  GisDisplayPagePrivate *priv = gis_display_page_get_instance_private (page);
+  GnomeRROutputInfo *output = priv->current_output;
+  char *output_name;
+  int width, height;
+
+  output_name = gnome_rr_output_info_get_name (output);
+  gnome_rr_output_info_get_geometry (output, NULL, NULL, &width, &height);
+
+  return strncmp (output_name, "HDMI", 4) == 0 &&
+    ((width == 1920 && height == 1080) ||
+     (width == 1440 && height == 1080) ||
+     (width == 1280 && height == 720));
+}
+
 static void
 gis_display_page_dispose (GObject *gobject)
 {
@@ -168,6 +185,12 @@ gis_display_page_constructed (GObject *object)
       goto out;
     }
 
+  if (!should_display_overscan (page))
+    {
+      g_debug ("Not using an HD resolution on HDMI. Hiding overscan page.");
+      goto out;
+    }
+
   visible = TRUE;
   priv->screen_changed_id = g_signal_connect_swapped (priv->screen,
                                                       "changed",


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