summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/compositor/compositor-xrender.c199
-rw-r--r--src/core/display-private.h2
-rw-r--r--src/core/display.c28
-rw-r--r--src/include/display.h3
5 files changed, 59 insertions, 175 deletions
diff --git a/configure.ac b/configure.ac
index df0050c2..a637fbd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,7 +224,7 @@ fi
## or the render-specific check later
have_xrender=no
-XCOMPOSITE_VERSION=0.2
+XCOMPOSITE_VERSION=0.3
if test x$enable_compositor = xyes; then
have_xcomposite=yes
elif test x$enable_compositor = xauto; then
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 156be239..4e8030d2 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -50,39 +50,8 @@
#include <X11/extensions/Xfixes.h>
#include <X11/extensions/Xrender.h>
-#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
-#define HAVE_NAME_WINDOW_PIXMAP 1
-#endif
-
-#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 3
-#define HAVE_COW 1
-#else
-/* Don't have a cow man...HAAHAAHAA */
-#endif
-
#define USE_IDLE_REPAINT 1
-#ifdef HAVE_COMPOSITE_EXTENSIONS
-static inline gboolean
-composite_at_least_version (MetaDisplay *display,
- int maj, int min)
-{
- static int major = -1;
- static int minor = -1;
-
- if (major == -1)
- meta_display_get_compositor_version (display, &major, &minor);
-
- return (major > maj || (major == maj && minor >= min));
-}
-
-#define have_name_window_pixmap(display) \
- composite_at_least_version (display, 0, 2)
-#define have_cow(display) \
- composite_at_least_version (display, 0, 3)
-
-#endif
-
typedef enum _MetaCompWindowType
{
META_COMP_WINDOW_NORMAL,
@@ -180,7 +149,6 @@ typedef struct _MetaCompWindow
Window id;
XWindowAttributes attrs;
-#ifdef HAVE_NAME_WINDOW_PIXMAP
Pixmap back_pixmap;
/* When the window is shaded back_pixmap will be replaced with the pixmap
@@ -188,7 +156,6 @@ typedef struct _MetaCompWindow
so that we can still see what the window looked like when it is needed
for the _get_window_pixmap function */
Pixmap shaded_back_pixmap;
-#endif
int mode;
@@ -1067,16 +1034,11 @@ get_window_picture (MetaCompWindow *cw)
meta_error_trap_push (display);
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (display))
- {
- if (cw->back_pixmap == None)
- cw->back_pixmap = XCompositeNameWindowPixmap (xdisplay, cw->id);
+ if (cw->back_pixmap == None)
+ cw->back_pixmap = XCompositeNameWindowPixmap (xdisplay, cw->id);
- if (cw->back_pixmap != None)
- draw = cw->back_pixmap;
- }
-#endif
+ if (cw->back_pixmap != None)
+ draw = cw->back_pixmap;
format = get_window_format (cw);
if (format)
@@ -1231,22 +1193,10 @@ paint_windows (MetaScreen *screen,
{
int x, y, wid, hei;
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (display))
- {
- x = cw->attrs.x;
- y = cw->attrs.y;
- wid = cw->attrs.width + cw->attrs.border_width * 2;
- hei = cw->attrs.height + cw->attrs.border_width * 2;
- }
- else
-#endif
- {
- x = cw->attrs.x + cw->attrs.border_width;
- y = cw->attrs.y + cw->attrs.border_width;
- wid = cw->attrs.width;
- hei = cw->attrs.height;
- }
+ x = cw->attrs.x;
+ y = cw->attrs.y;
+ wid = cw->attrs.width + cw->attrs.border_width * 2;
+ hei = cw->attrs.height + cw->attrs.border_width * 2;
XFixesSetPictureClipRegion (xdisplay, root_buffer,
0, 0, paint_region);
@@ -1322,22 +1272,11 @@ paint_windows (MetaScreen *screen,
if (cw->mode == WINDOW_ARGB)
{
int x, y, wid, hei;
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (display))
- {
- x = cw->attrs.x;
- y = cw->attrs.y;
- wid = cw->attrs.width + cw->attrs.border_width * 2;
- hei = cw->attrs.height + cw->attrs.border_width * 2;
- }
- else
-#endif
- {
- x = cw->attrs.x + cw->attrs.border_width;
- y = cw->attrs.y + cw->attrs.border_width;
- wid = cw->attrs.width;
- hei = cw->attrs.height;
- }
+
+ x = cw->attrs.x;
+ y = cw->attrs.y;
+ wid = cw->attrs.width + cw->attrs.border_width * 2;
+ hei = cw->attrs.height + cw->attrs.border_width * 2;
XRenderComposite (xdisplay, PictOpOver, cw->picture,
cw->alpha_pict, root_buffer, 0, 0, 0, 0,
@@ -1573,23 +1512,18 @@ free_win (MetaCompWindow *cw,
}
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (display))
+ /* See comment in map_win */
+ if (cw->back_pixmap && destroy)
{
- /* See comment in map_win */
- if (cw->back_pixmap && destroy)
- {
- XFreePixmap (xdisplay, cw->back_pixmap);
- cw->back_pixmap = None;
- }
+ XFreePixmap (xdisplay, cw->back_pixmap);
+ cw->back_pixmap = None;
+ }
- if (cw->shaded_back_pixmap && destroy)
- {
- XFreePixmap (xdisplay, cw->shaded_back_pixmap);
- cw->shaded_back_pixmap = None;
- }
+ if (cw->shaded_back_pixmap && destroy)
+ {
+ XFreePixmap (xdisplay, cw->shaded_back_pixmap);
+ cw->shaded_back_pixmap = None;
}
-#endif
if (cw->picture)
{
@@ -1663,7 +1597,6 @@ map_win (MetaDisplay *display,
if (cw == NULL)
return;
-#ifdef HAVE_NAME_WINDOW_PIXMAP
/* The reason we deallocate this here and not in unmap
is so that we will still have a valid pixmap for
whenever the window is unmapped */
@@ -1678,7 +1611,6 @@ map_win (MetaDisplay *display,
XFreePixmap (xdisplay, cw->shaded_back_pixmap);
cw->shaded_back_pixmap = None;
}
-#endif
cw->attrs.map_state = IsViewable;
cw->damaged = FALSE;
@@ -1872,11 +1804,8 @@ add_win (MetaScreen *screen,
XSelectInput (xdisplay, xwindow, event_mask);
-
-#ifdef HAVE_NAME_WINDOW_PIXMAP
cw->back_pixmap = None;
cw->shaded_back_pixmap = None;
-#endif
cw->damaged = FALSE;
cw->shaped = is_shaped (display, xwindow);
@@ -2058,32 +1987,28 @@ resize_win (MetaCompWindow *cw,
if (cw->attrs.width != width || cw->attrs.height != height)
{
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (display))
+ if (cw->shaded_back_pixmap)
+ {
+ XFreePixmap (xdisplay, cw->shaded_back_pixmap);
+ cw->shaded_back_pixmap = None;
+ }
+
+ if (cw->back_pixmap)
{
- if (cw->shaded_back_pixmap)
+ /* If the window is shaded, we store the old backing pixmap
+ so we can return a proper image of the window */
+ if (cw->window && meta_window_is_shaded (cw->window))
{
- XFreePixmap (xdisplay, cw->shaded_back_pixmap);
- cw->shaded_back_pixmap = None;
+ cw->shaded_back_pixmap = cw->back_pixmap;
+ cw->back_pixmap = None;
}
-
- if (cw->back_pixmap)
+ else
{
- /* If the window is shaded, we store the old backing pixmap
- so we can return a proper image of the window */
- if (cw->window && meta_window_is_shaded (cw->window))
- {
- cw->shaded_back_pixmap = cw->back_pixmap;
- cw->back_pixmap = None;
- }
- else
- {
- XFreePixmap (xdisplay, cw->back_pixmap);
- cw->back_pixmap = None;
- }
+ XFreePixmap (xdisplay, cw->back_pixmap);
+ cw->back_pixmap = None;
}
}
-#endif
+
if (cw->picture)
{
XRenderFreePicture (xdisplay, cw->picture);
@@ -2520,29 +2445,22 @@ show_overlay_window (MetaScreen *screen,
{
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display);
+ XserverRegion region;
-#ifdef HAVE_COW
- if (have_cow (display))
- {
- XserverRegion region;
-
- region = XFixesCreateRegion (xdisplay, NULL, 0);
+ region = XFixesCreateRegion (xdisplay, NULL, 0);
- XFixesSetWindowShapeRegion (xdisplay, cow, ShapeBounding, 0, 0, 0);
- XFixesSetWindowShapeRegion (xdisplay, cow, ShapeInput, 0, 0, region);
+ XFixesSetWindowShapeRegion (xdisplay, cow, ShapeBounding, 0, 0, 0);
+ XFixesSetWindowShapeRegion (xdisplay, cow, ShapeInput, 0, 0, region);
- XFixesDestroyRegion (xdisplay, region);
+ XFixesDestroyRegion (xdisplay, region);
- damage_screen (screen);
- }
-#endif
+ damage_screen (screen);
}
static void
hide_overlay_window (MetaScreen *screen,
Window cow)
{
-#ifdef HAVE_COW
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display);
XserverRegion region;
@@ -2550,7 +2468,6 @@ hide_overlay_window (MetaScreen *screen,
region = XFixesCreateRegion (xdisplay, NULL, 0);
XFixesSetWindowShapeRegion (xdisplay, cow, ShapeBounding, 0, 0, region);
XFixesDestroyRegion (xdisplay, region);
-#endif
}
static Window
@@ -2562,17 +2479,8 @@ get_output_window (MetaScreen *screen)
xroot = meta_screen_get_xroot (screen);
-#ifdef HAVE_COW
- if (have_cow (display))
- {
- output = XCompositeGetOverlayWindow (xdisplay, xroot);
- XSelectInput (xdisplay, output, ExposureMask);
- }
- else
-#endif
- {
- output = xroot;
- }
+ output = XCompositeGetOverlayWindow (xdisplay, xroot);
+ XSelectInput (xdisplay, output, ExposureMask);
return output;
}
@@ -2709,9 +2617,7 @@ xrender_unmanage_screen (MetaCompositor *compositor,
CompositeRedirectManual);
meta_screen_unset_cm_selection (screen);
-#ifdef HAVE_COW
XCompositeReleaseOverlayWindow (xdisplay, info->output);
-#endif
g_free (info);
@@ -2877,17 +2783,10 @@ xrender_get_window_pixmap (MetaCompositor *compositor,
if (cw == NULL)
return None;
-#ifdef HAVE_NAME_WINDOW_PIXMAP
- if (have_name_window_pixmap (meta_window_get_display (window)))
- {
- if (meta_window_is_shaded (window))
- return cw->shaded_back_pixmap;
- else
- return cw->back_pixmap;
- }
+ if (meta_window_is_shaded (window))
+ return cw->shaded_back_pixmap;
else
-#endif
- return None;
+ return cw->back_pixmap;
#endif
}
diff --git a/src/core/display-private.h b/src/core/display-private.h
index f204af0f..069e0ccf 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -276,8 +276,6 @@ struct _MetaDisplay {
#ifdef HAVE_COMPOSITE_EXTENSIONS
int composite_event_base;
int composite_error_base;
- int composite_major_version;
- int composite_minor_version;
int damage_event_base;
int damage_error_base;
int xfixes_event_base;
diff --git a/src/core/display.c b/src/core/display.c
index bcb262af..caa76247 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -558,6 +558,9 @@ meta_display_open (void)
#ifdef HAVE_COMPOSITE_EXTENSIONS
{
+ int composite_major_version = 0;
+ int composite_minor_version = 0;
+
the_display->have_composite = FALSE;
the_display->composite_error_base = 0;
@@ -572,18 +575,16 @@ meta_display_open (void)
}
else
{
- the_display->composite_major_version = 0;
- the_display->composite_minor_version = 0;
if (XCompositeQueryVersion (the_display->xdisplay,
- &the_display->composite_major_version,
- &the_display->composite_minor_version))
+ &composite_major_version,
+ &composite_minor_version))
{
the_display->have_composite = TRUE;
}
else
{
- the_display->composite_major_version = 0;
- the_display->composite_minor_version = 0;
+ composite_major_version = 0;
+ composite_minor_version = 0;
}
}
@@ -591,8 +592,8 @@ meta_display_open (void)
"extn ver %d %d\n",
the_display->composite_error_base,
the_display->composite_event_base,
- the_display->composite_major_version,
- the_display->composite_minor_version);
+ composite_major_version,
+ composite_minor_version);
the_display->have_damage = FALSE;
@@ -5389,17 +5390,6 @@ meta_display_remove_autoraise_callback (MetaDisplay *display)
}
}
-#ifdef HAVE_COMPOSITE_EXTENSIONS
-void
-meta_display_get_compositor_version (MetaDisplay *display,
- int *major,
- int *minor)
-{
- *major = display->composite_major_version;
- *minor = display->composite_minor_version;
-}
-#endif
-
Display *
meta_display_get_xdisplay (MetaDisplay *display)
{
diff --git a/src/include/display.h b/src/include/display.h
index a8dc49eb..5b0e5642 100644
--- a/src/include/display.h
+++ b/src/include/display.h
@@ -29,9 +29,6 @@
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
-void meta_display_get_compositor_version (MetaDisplay *display,
- int *major,
- int *minor);
Display *meta_display_get_xdisplay (MetaDisplay *display);
MetaCompositor *meta_display_get_compositor (MetaDisplay *display);
GSList *meta_display_get_screens (MetaDisplay *display);