mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 23:00:05 +01:00
Add panoramix overlay window support.
This commit is contained in:
parent
cd434b8f22
commit
dbffd0d44a
3 changed files with 162 additions and 5 deletions
|
|
@ -490,6 +490,96 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
|
|||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
{
|
||||
static PanoramiXRes *overlayWin = NULL;
|
||||
PanoramiXRes *win;
|
||||
int i;
|
||||
|
||||
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
||||
client, stuff->window, XRT_WINDOW, DixUnknownAccess)))
|
||||
{
|
||||
client->errorValue = stuff->window;
|
||||
return BadWindow;
|
||||
}
|
||||
|
||||
FOR_NSCREENS(i) {
|
||||
rc = dixLookupResource((pointer *)&pWin, stuff->window,
|
||||
RT_WINDOW, client,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
client->errorValue = stuff->window;
|
||||
return (rc == BadValue) ? BadWindow : rc;
|
||||
}
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
||||
/*
|
||||
* Create an OverlayClient structure to mark this client's
|
||||
* interest in the overlay window
|
||||
*/
|
||||
pOc = compCreateOverlayClient(pScreen, client);
|
||||
if (pOc == NULL)
|
||||
return BadAlloc;
|
||||
|
||||
/*
|
||||
* Make sure the overlay window exists
|
||||
*/
|
||||
cs = GetCompScreen(pScreen);
|
||||
if (cs->pOverlayWin == NULL)
|
||||
if (!compCreateOverlayWindow(pScreen))
|
||||
{
|
||||
FreeResource (pOc->resource, RT_NONE);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
rc = XaceHook(XACE_RESOURCE_ACCESS, client,
|
||||
cs->pOverlayWin->drawable.id,
|
||||
RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
FreeResource (pOc->resource, RT_NONE);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (!overlayWin)
|
||||
{
|
||||
if(!(overlayWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
||||
return BadAlloc;
|
||||
|
||||
overlayWin->type = XRT_WINDOW;
|
||||
overlayWin->u.win.root = FALSE;
|
||||
|
||||
FOR_NSCREENS(i) {
|
||||
cs = GetCompScreen(screenInfo.screens[i]);
|
||||
overlayWin->info[i].id = cs->pOverlayWin->drawable.id;
|
||||
}
|
||||
|
||||
AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin);
|
||||
}
|
||||
|
||||
rep.type = X_Reply;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.length = 0;
|
||||
rep.overlayWin = overlayWin->info[0].id;
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
int n;
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
swapl(&rep.length, n);
|
||||
swapl(&rep.overlayWin, n);
|
||||
}
|
||||
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
|
||||
|
||||
return client->noClientException;
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = dixLookupResource((pointer *)&pWin, stuff->window, RT_WINDOW, client,
|
||||
DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
|
|
@ -552,6 +642,45 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
|
|||
CompOverlayClientPtr pOc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
{
|
||||
PanoramiXRes *win;
|
||||
int i;
|
||||
|
||||
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
||||
client, stuff->window, XRT_WINDOW, DixUnknownAccess)))
|
||||
{
|
||||
client->errorValue = stuff->window;
|
||||
return BadWindow;
|
||||
}
|
||||
|
||||
FOR_NSCREENS(i) {
|
||||
pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
|
||||
if (!pWin)
|
||||
{
|
||||
client->errorValue = stuff->window;
|
||||
return BadWindow;
|
||||
}
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
|
||||
/*
|
||||
* Has client queried a reference to the overlay window
|
||||
* on this screen? If not, generate an error.
|
||||
*/
|
||||
pOc = compFindOverlayClient (pWin->drawable.pScreen, client);
|
||||
if (pOc == NULL)
|
||||
return BadMatch;
|
||||
|
||||
/* The delete function will free the client structure */
|
||||
FreeResource (pOc->resource, RT_NONE);
|
||||
}
|
||||
|
||||
return client->noClientException;
|
||||
}
|
||||
#endif
|
||||
|
||||
pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW);
|
||||
if (!pWin)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@
|
|||
#include "compint.h"
|
||||
#include "xace.h"
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiXsrv.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Delete the given overlay client list element from its screen list.
|
||||
*/
|
||||
|
|
@ -127,10 +131,20 @@ compCreateOverlayWindow (ScreenPtr pScreen)
|
|||
WindowPtr pWin;
|
||||
XID overrideRedirect = TRUE;
|
||||
int result;
|
||||
int w = pScreen->width;
|
||||
int h = pScreen->height;
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
{
|
||||
w = PanoramiXPixWidth;
|
||||
h = PanoramiXPixHeight;
|
||||
}
|
||||
#endif
|
||||
|
||||
pWin = cs->pOverlayWin =
|
||||
CreateWindow (cs->overlayWid, pRoot,
|
||||
0, 0, pScreen->width, pScreen->height, 0,
|
||||
0, 0, w, h, 0,
|
||||
InputOutput, CWOverrideRedirect, &overrideRedirect,
|
||||
pRoot->drawable.depth,
|
||||
serverClient, pScreen->rootVisual, &result);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@
|
|||
|
||||
#include "compint.h"
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiXsrv.h"
|
||||
#endif
|
||||
|
||||
#ifdef COMPOSITE_DEBUG
|
||||
static int
|
||||
compCheckWindow (WindowPtr pWin, pointer data)
|
||||
|
|
@ -171,16 +175,26 @@ updateOverlayWindow(ScreenPtr pScreen)
|
|||
CompScreenPtr cs;
|
||||
WindowPtr pWin; /* overlay window */
|
||||
XID vlist[2];
|
||||
int w = pScreen->width;
|
||||
int h = pScreen->height;
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if (!noPanoramiXExtension)
|
||||
{
|
||||
w = PanoramiXPixWidth;
|
||||
h = PanoramiXPixHeight;
|
||||
}
|
||||
#endif
|
||||
|
||||
cs = GetCompScreen(pScreen);
|
||||
if ((pWin = cs->pOverlayWin) != NULL) {
|
||||
if ((pWin->drawable.width == pScreen->width) &&
|
||||
(pWin->drawable.height == pScreen->height))
|
||||
if ((pWin->drawable.width == w) &&
|
||||
(pWin->drawable.height == h))
|
||||
return Success;
|
||||
|
||||
/* Let's resize the overlay window. */
|
||||
vlist[0] = pScreen->width;
|
||||
vlist[1] = pScreen->height;
|
||||
vlist[0] = w;
|
||||
vlist[1] = h;
|
||||
return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue