[gnome-flashback/gnome-3-18] display-config: fix crash with XRandR 1.2
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/gnome-3-18] display-config: fix crash with XRandR 1.2
- Date: Mon, 18 Jan 2016 15:49:21 +0000 (UTC)
commit cd8112f4d5fb91b7584898baae6dfe79824bad7f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Jan 18 17:42:36 2016 +0200
display-config: fix crash with XRandR 1.2
Attempt to fix crash reported here:
https://mail.gnome.org/archives/gnome-flashback-list/2015-December/msg00021.html
.../libdisplay-config/flashback-monitor-manager.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
index 29f80ef..27661cc 100644
--- a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
+++ b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
@@ -56,6 +56,7 @@ struct _FlashbackMonitorManagerPrivate
int rr_event_base;
int rr_error_base;
+ gboolean has_randr13;
gboolean has_randr15;
MetaDBusDisplayConfig *display_config;
@@ -1190,7 +1191,11 @@ read_current_config (FlashbackMonitorManager *manager)
manager->screen_width = WidthOfScreen (screen);
manager->screen_height = HeightOfScreen (screen);
- resources = XRRGetScreenResourcesCurrent (priv->xdisplay, DefaultRootWindow (priv->xdisplay));
+ if (priv->has_randr13)
+ resources = XRRGetScreenResourcesCurrent (priv->xdisplay, DefaultRootWindow (priv->xdisplay));
+ else
+ resources = XRRGetScreenResources (priv->xdisplay, DefaultRootWindow (priv->xdisplay));
+
if (!resources)
return;
@@ -1520,10 +1525,14 @@ flashback_monitor_manager_init (FlashbackMonitorManager *manager)
RRScreenChangeNotifyMask | RRCrtcChangeNotifyMask |
RROutputPropertyNotifyMask);
+ priv->has_randr13 = FALSE;
priv->has_randr15 = FALSE;
XRRQueryVersion (priv->xdisplay, &major_version, &minor_version);
+ if (major_version > 1 || (major_version == 1 && minor_version >= 3))
+ priv->has_randr13 = TRUE;
+
#ifdef HAVE_XRANDR15
if (major_version > 1 || (major_version == 1 && minor_version >= 5))
priv->has_randr15 = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]