2006-08-28 23:00:23 +00:00
|
|
|
--- ./hw/xfree86/xaa/xaa.h.offscreen-pixmaps 2006-08-28 15:33:34.000000000 -0400
|
|
|
|
+++ ./hw/xfree86/xaa/xaa.h 2006-08-28 15:33:36.000000000 -0400
|
|
|
|
@@ -1373,6 +1373,9 @@
|
|
|
|
);
|
|
|
|
CARD32 *CPUToScreenTextureDstFormats;
|
|
|
|
#endif /* RENDER */
|
|
|
|
+
|
|
|
|
+ unsigned int savedOffscreenDepths;
|
|
|
|
+
|
|
|
|
} XAAInfoRec, *XAAInfoRecPtr;
|
|
|
|
|
|
|
|
#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
|
|
|
|
--- ./hw/xfree86/xaa/xaaInit.c.offscreen-pixmaps 2006-07-05 14:31:42.000000000 -0400
|
|
|
|
+++ ./hw/xfree86/xaa/xaaInit.c 2006-08-28 15:31:03.000000000 -0400
|
2006-08-08 18:17:36 +00:00
|
|
|
@@ -4,6 +4,7 @@
|
|
|
|
#include <xorg-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#include <string.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86_OSproc.h"
|
|
|
|
@@ -20,6 +21,7 @@
|
|
|
|
#include "xaawrap.h"
|
|
|
|
#include "xf86fbman.h"
|
|
|
|
#include "servermd.h"
|
|
|
|
+#include "selection.h"
|
|
|
|
|
|
|
|
#define MAX_PREALLOC_MEM 65536 /* MUST be >= 1024 */
|
|
|
|
|
2006-08-28 23:00:23 +00:00
|
|
|
@@ -98,6 +100,49 @@
|
2006-08-08 16:33:11 +00:00
|
|
|
xfree(infoRec);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+SelectionChangedCallback (CallbackListPtr *list,
|
|
|
|
+ pointer xaaData, pointer callData)
|
|
|
|
+{
|
|
|
|
+ static char atom_name[] = "_COMPIZ_GL_INCLUDE_INFERIORS";
|
|
|
|
+
|
2006-08-08 18:17:36 +00:00
|
|
|
+ SelectionInfoRec *info = callData;
|
|
|
|
+ XAAInfoRecPtr infoRec = xaaData;
|
|
|
|
+ ScreenPtr pScreen = infoRec->pScrn->pScreen;
|
|
|
|
+ Atom atom;
|
2006-08-08 16:33:11 +00:00
|
|
|
+
|
2006-08-08 18:17:36 +00:00
|
|
|
+ atom = MakeAtom(atom_name, strlen(atom_name), 0);
|
2006-08-28 23:00:23 +00:00
|
|
|
+ if (info->selection->selection != atom)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ if (info->kind == SelectionSetOwner && info->selection->window != None)
|
2006-08-08 16:33:11 +00:00
|
|
|
+ {
|
2006-08-28 23:00:23 +00:00
|
|
|
+ infoRec->savedOffscreenDepths = infoRec->offscreenDepths;
|
2006-08-08 16:33:11 +00:00
|
|
|
+ infoRec->offscreenDepths = 0;
|
|
|
|
+ infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
|
|
|
|
+
|
|
|
|
+ XAAMoveOutOffscreenPixmaps(pScreen);
|
|
|
|
+ XAAInvalidatePixmapCache(pScreen);
|
2006-08-28 23:00:23 +00:00
|
|
|
+
|
|
|
|
+ xf86MsgVerb(X_INFO, 3, "'%s' selection grabbed; evicting pixmaps for screen %d\n",
|
|
|
|
+ atom_name, pScreen->myNum);
|
|
|
|
+ }
|
|
|
|
+ else if (infoRec->savedOffscreenDepths > 0)
|
|
|
|
+ {
|
|
|
|
+ infoRec->Flags |= OFFSCREEN_PIXMAPS;
|
|
|
|
+ infoRec->offscreenDepths = infoRec->savedOffscreenDepths;
|
|
|
|
+
|
|
|
|
+ if (!SwitchedOut) {
|
|
|
|
+ xf86MsgVerb(X_INFO, 3, "'%s' selection released; pulling in pixmaps for screen %d\n",
|
|
|
|
+ atom_name, pScreen->myNum);
|
|
|
|
+
|
|
|
|
+ XAAMoveInOffscreenPixmaps(pScreen);
|
|
|
|
+ } else {
|
|
|
|
+ xf86MsgVerb(X_INFO, 3, "'%s' selection released; will pull in pixmaps for screen %d when switched back in.\n",
|
|
|
|
+ atom_name, pScreen->myNum);
|
|
|
|
+ }
|
2006-08-08 16:33:11 +00:00
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
Bool
|
|
|
|
XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
|
2006-08-28 23:00:23 +00:00
|
|
|
@@ -228,11 +273,11 @@
|
2006-08-08 16:33:11 +00:00
|
|
|
if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
|
|
|
|
miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
|
|
|
|
|
|
|
|
+ AddCallback(&SelectionCallback, SelectionChangedCallback, infoRec);
|
|
|
|
+
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
static Bool
|
|
|
|
XAACloseScreen (int i, ScreenPtr pScreen)
|
|
|
|
{
|
2006-08-28 23:00:23 +00:00
|
|
|
@@ -264,6 +309,9 @@
|
2006-08-08 16:33:11 +00:00
|
|
|
|
|
|
|
xfree ((pointer) pScreenPriv);
|
|
|
|
|
2006-08-08 18:17:36 +00:00
|
|
|
+ DeleteCallback(&SelectionCallback, SelectionChangedCallback,
|
|
|
|
+ pScreenPriv->AccelInfoRec);
|
2006-08-08 16:33:11 +00:00
|
|
|
+
|
|
|
|
return (*pScreen->CloseScreen) (i, pScreen);
|
|
|
|
}
|
|
|
|
|