summaryrefslogtreecommitdiff
path: root/src/gpm-brightness.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-12-15 16:48:47 +0300
committermonsta <[email protected]>2015-12-15 16:48:47 +0300
commitdf94b62685f640c4e1854eec5736e01f812a2d66 (patch)
tree7c70da93e10151f44492df5addc993d0be74a653 /src/gpm-brightness.c
parent6c5989a7646419b05c387ca2d46ca27310b27494 (diff)
downloadmate-power-manager-df94b62685f640c4e1854eec5736e01f812a2d66.tar.bz2
mate-power-manager-df94b62685f640c4e1854eec5736e01f812a2d66.tar.xz
don't crash when XRRGetScreenResourcesCurrent fails
Diffstat (limited to 'src/gpm-brightness.c')
-rw-r--r--src/gpm-brightness.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index 8600474..686f676 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -846,7 +846,12 @@ gpm_brightness_update_cache (GpmBrightness *brightness)
}
root = RootWindow (brightness->priv->dpy, screen);
+
+ gdk_error_trap_push ();
resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root);
+ if (gdk_error_trap_pop () || resource == NULL) {
+ egg_warning ("failed to XRRGetScreenResourcesCurrent");
+ }
if (resource != NULL) {
egg_debug ("adding resource %p", resource);