[gnome-desktop] gnome-rr: Use "Built-in Display" for internal displays



commit b3b1d5fd9c1825573628ad097d76d1fd6400dd2f
Author: Shih-Yuan Lee (FourDollars) <fourdollars gmail com>
Date:   Thu Jul 12 20:25:04 2012 +0800

    gnome-rr: Use "Built-in Display" for internal displays
    
    Instead of "Laptop" as all-in-ones, tablets, etc. are devices
    that will get detected as having internal displays, but aren't
    laptops.
    
    Also rename all the functions with "laptop" in the name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679794

 .../gnome-desktop3/gnome-desktop3-sections.txt     |    2 +-
 libgnome-desktop/gnome-rr-config.c                 |   16 ++++++++--------
 libgnome-desktop/gnome-rr-debug.c                  |    2 +-
 libgnome-desktop/gnome-rr-private.h                |    2 +-
 libgnome-desktop/gnome-rr.c                        |   10 +++++-----
 libgnome-desktop/gnome-rr.h                        |    4 ++--
 6 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/docs/reference/gnome-desktop3/gnome-desktop3-sections.txt 
b/docs/reference/gnome-desktop3/gnome-desktop3-sections.txt
index 09bfaaa..c846073 100644
--- a/docs/reference/gnome-desktop3/gnome-desktop3-sections.txt
+++ b/docs/reference/gnome-desktop3/gnome-desktop3-sections.txt
@@ -297,7 +297,7 @@ gnome_rr_output_get_possible_crtcs
 gnome_rr_output_get_current_mode
 gnome_rr_output_get_crtc
 gnome_rr_output_get_connector_type
-gnome_rr_output_is_laptop
+gnome_rr_output_is_builtin_display
 gnome_rr_output_get_position
 gnome_rr_output_can_clone
 gnome_rr_output_list_modes
diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 4f02509..06ff2e6 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -1170,14 +1170,14 @@ gboolean
 gnome_rr_config_ensure_primary (GnomeRRConfig *configuration)
 {
         int i;
-        GnomeRROutputInfo  *laptop;
+        GnomeRROutputInfo  *builtin_display;
         GnomeRROutputInfo  *top_left;
         gboolean found;
        GnomeRRConfigPrivate *priv;
 
        g_return_val_if_fail (GNOME_IS_RR_CONFIG (configuration), FALSE);
 
-        laptop = NULL;
+        builtin_display = NULL;
         top_left = NULL;
         found = FALSE;
        priv = configuration->priv;
@@ -1204,17 +1204,17 @@ gnome_rr_config_ensure_primary (GnomeRRConfig *configuration)
                         && info->priv->y < top_left->priv->y)) {
                         top_left = info;
                 }
-                if (laptop == NULL
-                    && _gnome_rr_output_name_is_laptop (info->priv->name)) {
+                if (builtin_display == NULL
+                    && _gnome_rr_output_name_is_builtin_display (info->priv->name)) {
                         /* shame we can't find the connector type
-                           as with gnome_rr_output_is_laptop */
-                        laptop = info;
+                           as with gnome_rr_output_is_builtin_display */
+                        builtin_display = info;
                 }
         }
 
         if (!found) {
-                if (laptop != NULL) {
-                        laptop->priv->primary = TRUE;
+                if (builtin_display != NULL) {
+                        builtin_display->priv->primary = TRUE;
                 } else if (top_left != NULL) {
                         /* Note: top_left can be NULL if all outputs are off */
                         top_left->priv->primary = TRUE;
diff --git a/libgnome-desktop/gnome-rr-debug.c b/libgnome-desktop/gnome-rr-debug.c
index 622d6cd..20fa090 100644
--- a/libgnome-desktop/gnome-rr-debug.c
+++ b/libgnome-desktop/gnome-rr-debug.c
@@ -84,7 +84,7 @@ main (int argc, char *argv[])
        for (i = 0; outputs[i] != NULL; i++) {
                g_print ("[%s]\n", gnome_rr_output_get_name (outputs[i]));
                g_print ("\tconnected: %i\n", gnome_rr_output_is_connected (outputs[i]));
-               g_print ("\tlaptop: %i\n", gnome_rr_output_is_laptop (outputs[i]));
+               g_print ("\tbuilt-in: %i\n", gnome_rr_output_is_builtin_display (outputs[i]));
                g_print ("\tprimary: %i\n", gnome_rr_output_get_is_primary (outputs[i]));
                g_print ("\tid: %i\n", gnome_rr_output_get_id (outputs[i]));
 
diff --git a/libgnome-desktop/gnome-rr-private.h b/libgnome-desktop/gnome-rr-private.h
index 6a6cf4a..edadbad 100644
--- a/libgnome-desktop/gnome-rr-private.h
+++ b/libgnome-desktop/gnome-rr-private.h
@@ -74,6 +74,6 @@ struct _GnomeRRConfigPrivate
   GnomeRROutputInfo **outputs;
 };
 
-gboolean _gnome_rr_output_name_is_laptop (const char *name);
+gboolean _gnome_rr_output_name_is_builtin_display (const char *name);
 
 #endif
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index c1ab320..6759030 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -1761,7 +1761,7 @@ ensure_display_name (GnomeRROutput *output)
         return;
 
     if (gnome_rr_output_is_laptop (output))
-        output->display_name = g_strdup (_("Laptop"));
+        output->display_name = g_strdup (_("Built-in Display"));
 
     if (output->display_name == NULL
         && output->edid_data != NULL) {
@@ -1976,7 +1976,7 @@ gnome_rr_output_get_connector_type (GnomeRROutput *output)
 }
 
 gboolean
-_gnome_rr_output_name_is_laptop (const char *name)
+_gnome_rr_output_name_is_builtin_display (const char *name)
 {
     if (!name)
         return FALSE;
@@ -1985,7 +1985,7 @@ _gnome_rr_output_name_is_laptop (const char *name)
        strstr (name, "LVDS") ||
        strstr (name, "Lvds") ||
        strstr (name, "LCD")  ||  /* ... but fglrx uses "LCD" in some versions.  Shoot me now, kthxbye. */
-       strstr (name, "eDP")  ||  /* eDP is for internal laptop panel connections */
+       strstr (name, "eDP")  ||  /* eDP is for internal built-in panel connections */
        strstr (name, "default")) /* Finally, NVidia and all others that don't bother to do RANDR properly */
         return TRUE;
 
@@ -1993,7 +1993,7 @@ _gnome_rr_output_name_is_laptop (const char *name)
 }
 
 gboolean
-gnome_rr_output_is_laptop (GnomeRROutput *output)
+gnome_rr_output_is_builtin_display (GnomeRROutput *output)
 {
     g_return_val_if_fail (output != NULL, FALSE);
 
@@ -2007,7 +2007,7 @@ gnome_rr_output_is_laptop (GnomeRROutput *output)
     /* Older versions of RANDR - this is a best guess, as @#$% RANDR doesn't have standard output names,
      * so drivers can use whatever they like.
      */
-    if (_gnome_rr_output_name_is_laptop (output->name))
+    if (_gnome_rr_output_name_is_builtin_display (output->name))
         return TRUE;
 
     return FALSE;
diff --git a/libgnome-desktop/gnome-rr.h b/libgnome-desktop/gnome-rr.h
index 776869f..08bceca 100644
--- a/libgnome-desktop/gnome-rr.h
+++ b/libgnome-desktop/gnome-rr.h
@@ -86,7 +86,7 @@ typedef enum {
     GNOME_RR_ERROR_NO_DPMS_EXTENSION,  /* DPMS extension is not present */
 } GnomeRRError;
 
-#define GNOME_RR_CONNECTOR_TYPE_PANEL "Panel"  /* This is a laptop's built-in LCD */
+#define GNOME_RR_CONNECTOR_TYPE_PANEL "Panel"  /* This is a built-in LCD */
 
 #define GNOME_TYPE_RR_SCREEN                  (gnome_rr_screen_get_type())
 #define GNOME_RR_SCREEN(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_RR_SCREEN, 
GnomeRRScreen))
@@ -172,7 +172,7 @@ GnomeRRCrtc **  gnome_rr_output_get_possible_crtcs (GnomeRROutput         *outpu
 GnomeRRMode *   gnome_rr_output_get_current_mode   (GnomeRROutput         *output);
 GnomeRRCrtc *   gnome_rr_output_get_crtc           (GnomeRROutput         *output);
 const char *    gnome_rr_output_get_connector_type (GnomeRROutput         *output);
-gboolean        gnome_rr_output_is_laptop          (GnomeRROutput         *output);
+gboolean        gnome_rr_output_is_builtin_display (GnomeRROutput         *output);
 void            gnome_rr_output_get_position       (GnomeRROutput         *output,
                                                    int                   *x,
                                                    int                   *y);


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