From 71055556ee37eb310297eb69e23e167fbcb961c2 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" <jstpierre@mecheye.net> Date: Mon, 30 Jul 2012 16:02:56 -0300 Subject: [PATCH] display: Require XFixes 5.0 We want to put barrier wrappers in mutter, which requre XFixes 5.0. XFixes 5.0 was released in March, 2011, which should be old enough to mandate support for. https://bugzilla.gnome.org/show_bug.cgi?id=677215 --- src/core/display-private.h | 2 -- src/core/display.c | 26 ++++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/display-private.h b/src/core/display-private.h index 86d798fe3..82bb2ea80 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -315,10 +315,8 @@ struct _MetaDisplay #define META_DISPLAY_HAS_RENDER(display) ((display)->have_render) unsigned int have_composite : 1; unsigned int have_damage : 1; - unsigned int have_xfixes : 1; #define META_DISPLAY_HAS_COMPOSITE(display) ((display)->have_composite) #define META_DISPLAY_HAS_DAMAGE(display) ((display)->have_damage) -#define META_DISPLAY_HAS_XFIXES(display) ((display)->have_xfixes) }; struct _MetaDisplayClass diff --git a/src/core/display.c b/src/core/display.c index 98a2d1fa1..c09b63e8d 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -388,13 +388,11 @@ enable_compositor (MetaDisplay *display, if (!META_DISPLAY_HAS_COMPOSITE (display) || !META_DISPLAY_HAS_DAMAGE (display) || - !META_DISPLAY_HAS_XFIXES (display) || !META_DISPLAY_HAS_RENDER (display)) { meta_warning (_("Missing %s extension required for compositing"), !META_DISPLAY_HAS_COMPOSITE (display) ? "composite" : - !META_DISPLAY_HAS_DAMAGE (display) ? "damage" : - !META_DISPLAY_HAS_XFIXES (display) ? "xfixes" : "render"); + !META_DISPLAY_HAS_DAMAGE (display) ? "damage" : "render"); return; } @@ -757,20 +755,24 @@ meta_display_open (void) the_display->damage_error_base, the_display->damage_event_base); - the_display->have_xfixes = FALSE; - the_display->xfixes_error_base = 0; the_display->xfixes_event_base = 0; - if (!XFixesQueryExtension (the_display->xdisplay, - &the_display->xfixes_event_base, - &the_display->xfixes_error_base)) + if (XFixesQueryExtension (the_display->xdisplay, + &the_display->xfixes_event_base, + &the_display->xfixes_error_base)) { - the_display->xfixes_error_base = 0; - the_display->xfixes_event_base = 0; - } + int xfixes_major, xfixes_minor; + + XFixesQueryVersion (the_display->xdisplay, &xfixes_major, &xfixes_minor); + + if (xfixes_major * 100 + xfixes_minor < 500) + meta_fatal ("Mutter requires XFixes 5.0"); + } else - the_display->have_xfixes = TRUE; + { + meta_fatal ("Mutter requires XFixes 5.0"); + } meta_verbose ("Attempted to init XFixes, found error base %d event base %d\n", the_display->xfixes_error_base,