Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
This commit is contained in:
commit
767f372dd0
@ -60,6 +60,8 @@ compCloseScreen (int index, ScreenPtr pScreen)
|
|||||||
CompScreenPtr cs = GetCompScreen (pScreen);
|
CompScreenPtr cs = GetCompScreen (pScreen);
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
|
xfree (cs->alternateVisuals);
|
||||||
|
|
||||||
pScreen->CloseScreen = cs->CloseScreen;
|
pScreen->CloseScreen = cs->CloseScreen;
|
||||||
pScreen->BlockHandler = cs->BlockHandler;
|
pScreen->BlockHandler = cs->BlockHandler;
|
||||||
pScreen->InstallColormap = cs->InstallColormap;
|
pScreen->InstallColormap = cs->InstallColormap;
|
||||||
@ -100,7 +102,7 @@ compInstallColormap (ColormapPtr pColormap)
|
|||||||
CompScreenPtr cs = GetCompScreen (pScreen);
|
CompScreenPtr cs = GetCompScreen (pScreen);
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
for (a = 0; a < NUM_COMP_ALTERNATE_VISUALS; a++)
|
for (a = 0; a < cs->numAlternateVisuals; a++)
|
||||||
if (pVisual->vid == cs->alternateVisuals[a])
|
if (pVisual->vid == cs->alternateVisuals[a])
|
||||||
return;
|
return;
|
||||||
pScreen->InstallColormap = cs->InstallColormap;
|
pScreen->InstallColormap = cs->InstallColormap;
|
||||||
@ -170,6 +172,41 @@ compFindVisuallessDepth (ScreenPtr pScreen, int d)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add a list of visual IDs to the list of visuals to implicitly redirect.
|
||||||
|
*/
|
||||||
|
static Bool
|
||||||
|
compRegisterAlternateVisuals (CompScreenPtr cs, VisualID *vids, int nVisuals)
|
||||||
|
{
|
||||||
|
VisualID *p;
|
||||||
|
|
||||||
|
p = xrealloc(cs->alternateVisuals,
|
||||||
|
sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
|
||||||
|
if(p == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
memcpy(&p[cs->numAlternateVisuals], vids, sizeof(VisualID) * nVisuals);
|
||||||
|
|
||||||
|
cs->alternateVisuals = p;
|
||||||
|
cs->numAlternateVisuals += nVisuals;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
_X_EXPORT
|
||||||
|
Bool CompositeRegisterAlternateVisuals (ScreenPtr pScreen, VisualID *vids,
|
||||||
|
int nVisuals)
|
||||||
|
{
|
||||||
|
CompScreenPtr cs = GetCompScreen (pScreen);
|
||||||
|
return compRegisterAlternateVisuals(cs, vids, nVisuals);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if COMP_INCLUDE_RGB24_VISUAL
|
||||||
|
#define NUM_COMP_ALTERNATE_VISUALS 2
|
||||||
|
#else
|
||||||
|
#define NUM_COMP_ALTERNATE_VISUALS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct _alternateVisual {
|
typedef struct _alternateVisual {
|
||||||
int depth;
|
int depth;
|
||||||
CARD32 format;
|
CARD32 format;
|
||||||
@ -197,8 +234,6 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
|||||||
int numAlternate = 0;
|
int numAlternate = 0;
|
||||||
int alt;
|
int alt;
|
||||||
|
|
||||||
memset (cs->alternateVisuals, '\0', sizeof (cs->alternateVisuals));
|
|
||||||
|
|
||||||
for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++)
|
for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++)
|
||||||
{
|
{
|
||||||
DepthPtr depth;
|
DepthPtr depth;
|
||||||
@ -321,7 +356,7 @@ compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs)
|
|||||||
/*
|
/*
|
||||||
* remember the visual ID to detect auto-update windows
|
* remember the visual ID to detect auto-update windows
|
||||||
*/
|
*/
|
||||||
cs->alternateVisuals[alt] = visual->vid;
|
compRegisterAlternateVisuals(cs, &visual->vid, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix up the depth
|
* Fix up the depth
|
||||||
@ -367,6 +402,9 @@ compScreenInit (ScreenPtr pScreen)
|
|||||||
cs->pOverlayWin = NULL;
|
cs->pOverlayWin = NULL;
|
||||||
cs->pOverlayClients = NULL;
|
cs->pOverlayClients = NULL;
|
||||||
|
|
||||||
|
cs->numAlternateVisuals = 0;
|
||||||
|
cs->alternateVisuals = NULL;
|
||||||
|
|
||||||
if (!compAddAlternateVisuals (pScreen, cs))
|
if (!compAddAlternateVisuals (pScreen, cs))
|
||||||
{
|
{
|
||||||
xfree (cs);
|
xfree (cs);
|
||||||
|
@ -109,12 +109,6 @@ typedef struct _CompSubwindows {
|
|||||||
#define COMP_INCLUDE_RGB24_VISUAL 0
|
#define COMP_INCLUDE_RGB24_VISUAL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if COMP_INCLUDE_RGB24_VISUAL
|
|
||||||
#define NUM_COMP_ALTERNATE_VISUALS 2
|
|
||||||
#else
|
|
||||||
#define NUM_COMP_ALTERNATE_VISUALS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
|
typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
|
||||||
|
|
||||||
typedef struct _CompOverlayClientRec {
|
typedef struct _CompOverlayClientRec {
|
||||||
@ -154,7 +148,8 @@ typedef struct _CompScreen {
|
|||||||
ScreenBlockHandlerProcPtr BlockHandler;
|
ScreenBlockHandlerProcPtr BlockHandler;
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
Bool damaged;
|
Bool damaged;
|
||||||
XID alternateVisuals[NUM_COMP_ALTERNATE_VISUALS];
|
int numAlternateVisuals;
|
||||||
|
VisualID *alternateVisuals;
|
||||||
|
|
||||||
WindowPtr pOverlayWin;
|
WindowPtr pOverlayWin;
|
||||||
CompOverlayClientPtr pOverlayClients;
|
CompOverlayClientPtr pOverlayClients;
|
||||||
@ -224,6 +219,10 @@ CompositeExtensionInit (void);
|
|||||||
* compinit.c
|
* compinit.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Bool
|
||||||
|
CompositeRegisterAlternateVisuals (ScreenPtr pScreen,
|
||||||
|
VisualID *vids, int nVisuals);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
compScreenInit (ScreenPtr pScreen);
|
compScreenInit (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ compIsAlternateVisual (ScreenPtr pScreen,
|
|||||||
CompScreenPtr cs = GetCompScreen (pScreen);
|
CompScreenPtr cs = GetCompScreen (pScreen);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_COMP_ALTERNATE_VISUALS; i++)
|
for (i = 0; i < cs->numAlternateVisuals; i++)
|
||||||
if (cs->alternateVisuals[i] == visual)
|
if (cs->alternateVisuals[i] == visual)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user