[gnome-settings-daemon/gnome-3-6] xrandr: Don't operate on a NULL object
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-6] xrandr: Don't operate on a NULL object
- Date: Wed, 23 Jan 2013 16:43:28 +0000 (UTC)
commit b4ed1323cad845212fda4c374003c4b4bb1c5616
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jan 23 05:52:50 2013 -0500
xrandr: Don't operate on a NULL object
I see a critical out of gnome_rr_config_set_clone in my session log.
It turns out all uses of that function in the xrandr plugin are
happening after possibly nulling the GnomeRRConfig they are operating
on.
This commit ensures the clone state is set immediately after creating
the object to correct that.
https://bugzilla.gnome.org/show_bug.cgi?id=692372
(cherry picked from commit 92b5f78720c788e730d17b40f5ec52e129aa8bee)
plugins/xrandr/gsd-xrandr-manager.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 5711c2d..b81a529 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -879,6 +879,8 @@ make_clone_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
return NULL;
result = gnome_rr_config_new_current (screen, NULL);
+ gnome_rr_config_set_clone (result, TRUE);
+
outputs = gnome_rr_config_get_outputs (result);
for (i = 0; outputs[i] != NULL; ++i) {
@@ -920,8 +922,6 @@ make_clone_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
result = NULL;
}
- gnome_rr_config_set_clone (result, TRUE);
-
print_configuration (result, "clone setup");
return result;
@@ -1003,6 +1003,8 @@ make_laptop_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (result);
int i;
+ gnome_rr_config_set_clone (result, FALSE);
+
for (i = 0; outputs[i] != NULL; ++i) {
GnomeRROutputInfo *info = outputs[i];
@@ -1018,13 +1020,12 @@ make_laptop_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
}
}
+
if (config_is_all_off (result)) {
g_object_unref (G_OBJECT (result));
result = NULL;
}
- gnome_rr_config_set_clone (result, FALSE);
-
print_configuration (result, "Laptop setup");
/* FIXME - Maybe we should return NULL if there is more than
@@ -1137,6 +1138,8 @@ make_xinerama_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
int i;
int x;
+ gnome_rr_config_set_clone (result, FALSE);
+
x = 0;
for (i = 0; outputs[i] != NULL; ++i) {
GnomeRROutputInfo *info = outputs[i];
@@ -1165,8 +1168,6 @@ make_xinerama_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
result = NULL;
}
- gnome_rr_config_set_clone (result, FALSE);
-
print_configuration (result, "xinerama setup");
return result;
@@ -1183,6 +1184,8 @@ make_other_setup (GnomeRRScreen *screen)
GnomeRROutputInfo **outputs = gnome_rr_config_get_outputs (result);
int i;
+ gnome_rr_config_set_clone (result, FALSE);
+
for (i = 0; outputs[i] != NULL; ++i) {
GnomeRROutputInfo *info = outputs[i];
@@ -1200,8 +1203,6 @@ make_other_setup (GnomeRRScreen *screen)
result = NULL;
}
- gnome_rr_config_set_clone (result, FALSE);
-
print_configuration (result, "other setup");
return result;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]