gnome-settings-daemon/dark-config.patch
2010-08-27 15:31:54 -04:00

58 lines
1.8 KiB
Diff

--- gnome-settings-daemon-2.31.6/plugins/xrandr/gsd-xrandr-manager.c 2010-08-02 17:54:13.000000000 -0400
+++ foo/plugins/xrandr/gsd-xrandr-manager.c 2010-08-27 14:48:39.506158001 -0400
@@ -684,6 +684,7 @@
/* Turn on the laptop, disable everything else */
GnomeRRConfig *result = gnome_rr_config_new_current (screen);
int i;
+ gboolean all_off = TRUE;
for (i = 0; result->outputs[i] != NULL; ++i) {
GnomeOutputInfo *info = result->outputs[i];
@@ -694,12 +695,18 @@
result = NULL;
break;
}
+ all_off = FALSE;
}
else {
info->on = FALSE;
}
}
+ if (all_off) {
+ gnome_rr_config_free (result);
+ result = NULL;
+ }
+
print_configuration (result, "Laptop setup");
/* FIXME - Maybe we should return NULL if there is more than
@@ -751,6 +758,7 @@
static GnomeRRConfig *
make_other_setup (GnomeRRScreen *screen)
{
+ gboolean all_off = TRUE;
/* Turn off all laptops, and make all external monitors clone
* from (0, 0)
*/
@@ -765,11 +773,18 @@
info->on = FALSE;
}
else {
- if (info->connected)
+ if (info->connected) {
turn_on (screen, info, 0, 0);
+ all_off = FALSE;
+ }
}
}
+ if (all_off) {
+ gnome_rr_config_free (result);
+ result = NULL;
+ }
+
print_configuration (result, "other setup");
return result;