have_xsm="yes"
fi
+ AC_CHECK_LIB(
+ [Xcomposite],
+ [XCompositeQueryExtension],
+ [XCOMPOSITE_LIBS="-lXcomposite"],
+ [have_xcomposite="no"]
+ [])
+ AC_CHECK_HEADERS([X11/extensions/Xcomposite.h],
+ [],
+ [have_xcomposite="no"],
+ [])
+ if test "$have_xcomposite" != "no"; then
+ have_xcomposite="yes"
+ fi
+
# If we're building with support for Unity, we'll need a few additional
# libraries.
if test "$enable_unity" != "no"; then
-
- # Unity needs the X11 Screen Saver extension library. It should be
+ # Unity needs the X11 Screen Saver extension library. It should be
# in the same place as the X11 libraries, so no need for any fancy
# path checking.
AC_VMW_CHECK_X11_LIB(
AM_CONDITIONAL(HAVE_ICU, test "$with_icu" = "yes")
AM_CONDITIONAL(WITH_KERNEL_MODULES, test "$with_kernel_modules" = "yes")
AM_CONDITIONAL(HAVE_XSM, test "$have_xsm" = "yes")
+AM_CONDITIONAL(HAVE_XCOMPOSITE, test "$have_xcomposite" = "yes")
AM_CONDITIONAL(ENABLE_UNITY, test "$enable_unity" = "yes")
AM_CONDITIONAL(ENABLE_TESTS, test "$have_cunit" = "yes")
AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes")
AC_DEFINE([NO_XSM], 1, [])
fi
+if test "$have_xcomposite" != "yes"; then
+ AC_DEFINE([NO_XCOMPOSITE])
+fi
+
### Feature-specific flags / actions
# Combine where possible
AC_SUBST([MODULES])
AC_SUBST([COMMON_XLIBS])
AC_SUBST([XSM_LIBS])
+AC_SUBST([XCOMPOSITE_LIBS])
AC_SUBST([PAM_PREFIX])
AC_SUBST([PLUGIN_CPPFLAGS])
AC_SUBST([PLUGIN_LDFLAGS])
#include <X11/extensions/Xinerama.h>
#include <X11/extensions/XTest.h>
+
+#ifndef NO_XCOMPOSITE
+# include <X11/extensions/Xcomposite.h>
+#endif
}
typedef struct {
static Bool SetWindowStickiness(UnityPlatform *up,
UnityWindowId windowId,
Bool wantSticky);
+static UnitySpecialWindow *MakeCompositeOverlaysObject(UnityPlatform *up);
static const GuestCapabilities platformUnityCaps[] = {
UNITY_CAP_WORK_AREA,
XSync(up->display, TRUE);
up->rootWindows = UnityPlatformMakeRootWindowsObject(up);
+ MakeCompositeOverlaysObject(up);
up->isRunning = TRUE;
up->eventTimeDiff = 0;
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * MakeCompositeOverlaysObject --
+ *
+ * Probes X server for any composite overlay windows. If found, they're
+ * monitored as UnitySpecialWindows whereby we won't mistakenly place them
+ * in the global window tracker.
+ *
+ * Results:
+ * Returns pointer to new UnitySpecialWindow on success, NULL on failure.
+ *
+ * Side effects:
+ * If overlay windows haven't yet been mapped, they will be (temporarily).
+ *
+ * Caller doesn't need to free returned UnitySpecialWindow*. That's handled
+ * automatically when exiting Unity.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+static UnitySpecialWindow *
+MakeCompositeOverlaysObject(UnityPlatform *up) // IN
+{
+ ASSERT(up);
+ ASSERT(up->rootWindows);
+
+#ifndef NO_XCOMPOSITE
+ int eventBase;
+ int errorBase;
+ if (XCompositeQueryExtension(up->display, &eventBase, &errorBase)) {
+ /*
+ * XCompositeGetOverlayWindow didn't appear until XComposite 0.3.
+ */
+ int major = 0;
+ int minor = 0;
+ XCompositeQueryVersion(up->display, &major, &minor);
+ if (major > 0 || (major == 0 && minor >= 3)) {
+ size_t nWindows = up->rootWindows->numWindows;
+ Window *overlays = (Window*)Util_SafeCalloc(nWindows, sizeof *overlays);
+ for (unsigned int i = 0; i < nWindows; i++) {
+ overlays[i] = XCompositeGetOverlayWindow(up->display,
+ up->rootWindows->windows[i]);
+ XCompositeReleaseOverlayWindow(up->display, overlays[i]);
+ }
+
+ /*
+ * Note 1: See above. Caller doesn't need to need to track this explicitly.
+ * Note 2: The NULL event handler parameter is how we tell the X event handling
+ * pieces to ignore this window, thereby keeping it out of the window
+ * tracker.
+ */
+ return USWindowCreate(up, NULL, overlays, nWindows);
+ }
+ }
+#endif // ifndef NO_XCOMPOSITE
+
+ return NULL;
+}
+
/*
*
* End file-scope functions.