[gnome-settings-daemon/temporary_revert_for_2_29_1_1: 1/2] Revert "RANDR - Use gnome_rr_output_is_laptop() instead of our own function"



commit 2785a27ae33ff67b1caee3cad8833cad4bb96e39
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Feb 24 15:37:20 2010 +0100

    Revert "RANDR - Use gnome_rr_output_is_laptop() instead of our own function"
    
    This reverts commit a1fc969510ae6f91884976e2b899210977e38b14.

 configure.ac                        |    2 +-
 plugins/xrandr/gsd-xrandr-manager.c |   30 +++++++++++++++++++-----------
 2 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 23959e6..1954d7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ GLIB_REQUIRED_VERSION=2.17.3
 GTK_REQUIRED_VERSION=2.16.0
 GCONF_REQUIRED_VERSION=2.6.1
 GIO_REQUIRED_VERSION=2.17.3
-GNOME_DESKTOP_REQUIRED_VERSION=2.29.92
+GNOME_DESKTOP_REQUIRED_VERSION=2.26.3
 LIBNOTIFY_REQUIRED_VERSION=0.4.3
 
 EXTRA_COMPILE_WARNINGS(yes)
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index e78eb6b..01d7e33 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -481,12 +481,20 @@ gsd_xrandr_manager_2_apply_configuration (GsdXrandrManager *manager,
 #include "gsd-xrandr-manager-glue.h"
 
 static gboolean
-is_laptop (GnomeRRScreen *screen, GnomeOutputInfo *output)
+is_laptop (GnomeOutputInfo *output)
 {
-        GnomeRROutput *rr_output;
+        const char *output_name = output->name;
 
-        rr_output = gnome_rr_screen_get_output_by_name (screen, output->name);
-        return gnome_rr_output_is_laptop (rr_output);
+        if (output->connected && output_name &&
+            (strstr (output_name, "lvds")	||
+             strstr (output_name, "LVDS")	||
+             strstr (output_name, "Lvds")       ||
+             strstr (output_name, "LCD")))
+        {
+                return TRUE;
+        }
+
+        return FALSE;
 }
 
 static gboolean
@@ -685,7 +693,7 @@ make_laptop_setup (GnomeRRScreen *screen)
         for (i = 0; result->outputs[i] != NULL; ++i) {
                 GnomeOutputInfo *info = result->outputs[i];
 
-                if (is_laptop (screen, info)) {
+                if (is_laptop (info)) {
                         if (!turn_on (screen, info, 0, 0)) {
                                 gnome_rr_config_free (result);
                                 result = NULL;
@@ -729,14 +737,14 @@ make_xinerama_setup (GnomeRRScreen *screen)
         for (i = 0; result->outputs[i] != NULL; ++i) {
                 GnomeOutputInfo *info = result->outputs[i];
 
-                if (is_laptop (screen, info))
+                if (is_laptop (info))
                         x = turn_on_and_get_rightmost_offset (screen, info, x);
         }
 
         for (i = 0; result->outputs[i] != NULL; ++i) {
                 GnomeOutputInfo *info = result->outputs[i];
 
-                if (info->connected && !is_laptop (screen, info))
+                if (info->connected && !is_laptop (info))
                         x = turn_on_and_get_rightmost_offset (screen, info, x);
         }
 
@@ -758,7 +766,7 @@ make_other_setup (GnomeRRScreen *screen)
         for (i = 0; result->outputs[i] != NULL; ++i) {
                 GnomeOutputInfo *info = result->outputs[i];
 
-                if (is_laptop (screen, info)) {
+                if (is_laptop (info)) {
                         info->on = FALSE;
                 }
                 else {
@@ -1008,7 +1016,7 @@ handle_fn_f7 (GsdXrandrManager *mgr, guint32 timestamp)
 }
 
 static GnomeOutputInfo *
-get_laptop_output_info (GnomeRRScreen *screen, GnomeRRConfig *config)
+get_laptop_output_info (GnomeRRConfig *config)
 {
         int i;
 
@@ -1016,7 +1024,7 @@ get_laptop_output_info (GnomeRRScreen *screen, GnomeRRConfig *config)
                 GnomeOutputInfo *info;
 
                 info = config->outputs[i];
-                if (is_laptop (screen, info))
+                if (is_laptop (info))
                         return info;
         }
 
@@ -1088,7 +1096,7 @@ handle_rotate_windows (GsdXrandrManager *mgr, guint32 timestamp)
 
         current = gnome_rr_config_new_current (screen);
 
-        rotatable_output_info = get_laptop_output_info (screen, current);
+        rotatable_output_info = get_laptop_output_info (current);
         if (rotatable_output_info == NULL) {
                 g_debug ("No laptop outputs found to rotate; XF86RotateWindows key will do nothing");
                 goto out;



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