diff options
author | monsta <[email protected]> | 2015-12-15 16:48:47 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2015-12-15 16:48:47 +0300 |
commit | df94b62685f640c4e1854eec5736e01f812a2d66 (patch) | |
tree | 7c70da93e10151f44492df5addc993d0be74a653 /src/gpm-brightness.c | |
parent | 6c5989a7646419b05c387ca2d46ca27310b27494 (diff) | |
download | mate-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.c | 5 |
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); |