summaryrefslogtreecommitdiff
path: root/xserver/composite/compoverlay.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-06-10 13:21:33 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-06-10 13:21:33 +0000
commit171e929a08098b6c844887adc43879c7579dc15f (patch)
tree6b4d2e3bc20dbd4dc9a1f031416e66614c53dd21 /xserver/composite/compoverlay.c
parent68781b09de2c95b87ea898c4ecf3018dfb4460d2 (diff)
Update to xserver 1.12.2. tested by naddy@, krw@, mpi@.
Diffstat (limited to 'xserver/composite/compoverlay.c')
-rw-r--r--xserver/composite/compoverlay.c93
1 files changed, 45 insertions, 48 deletions
diff --git a/xserver/composite/compoverlay.c b/xserver/composite/compoverlay.c
index 047f069ff..d3cfaf06f 100644
--- a/xserver/composite/compoverlay.c
+++ b/xserver/composite/compoverlay.c
@@ -56,54 +56,53 @@
* Delete the given overlay client list element from its screen list.
*/
void
-compFreeOverlayClient (CompOverlayClientPtr pOcToDel)
+compFreeOverlayClient(CompOverlayClientPtr pOcToDel)
{
- ScreenPtr pScreen = pOcToDel->pScreen;
- CompScreenPtr cs = GetCompScreen (pScreen);
- CompOverlayClientPtr *pPrev, pOc;
-
- for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext)
- {
- if (pOc == pOcToDel) {
- *pPrev = pOc->pNext;
- free(pOc);
- break;
- }
+ ScreenPtr pScreen = pOcToDel->pScreen;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ CompOverlayClientPtr *pPrev, pOc;
+
+ for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext) {
+ if (pOc == pOcToDel) {
+ *pPrev = pOc->pNext;
+ free(pOc);
+ break;
+ }
}
-
+
/* Destroy overlay window when there are no more clients using it */
if (cs->pOverlayClients == NULL)
- compDestroyOverlayWindow (pScreen);
+ compDestroyOverlayWindow(pScreen);
}
/*
* Return the client's first overlay client rec from the given screen
*/
CompOverlayClientPtr
-compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
+compFindOverlayClient(ScreenPtr pScreen, ClientPtr pClient)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
- CompOverlayClientPtr pOc;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ CompOverlayClientPtr pOc;
for (pOc = cs->pOverlayClients; pOc != NULL; pOc = pOc->pNext)
- if (pOc->pClient == pClient)
- return pOc;
+ if (pOc->pClient == pClient)
+ return pOc;
- return NULL;
+ return NULL;
}
/*
* Create an overlay client object for the given client
*/
CompOverlayClientPtr
-compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
+compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
+ CompScreenPtr cs = GetCompScreen(pScreen);
CompOverlayClientPtr pOc;
pOc = (CompOverlayClientPtr) malloc(sizeof(CompOverlayClientRec));
if (pOc == NULL)
- return NULL;
+ return NULL;
pOc->pClient = pClient;
pOc->pScreen = pScreen;
@@ -115,8 +114,8 @@ compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
* Create a resource for this element so it can be deleted
* when the client goes away.
*/
- if (!AddResource (pOc->resource, CompositeClientOverlayType, (pointer) pOc))
- return NULL;
+ if (!AddResource(pOc->resource, CompositeClientOverlayType, (pointer) pOc))
+ return NULL;
return pOc;
}
@@ -125,34 +124,33 @@ compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient)
* Create the overlay window and map it
*/
Bool
-compCreateOverlayWindow (ScreenPtr pScreen)
+compCreateOverlayWindow(ScreenPtr pScreen)
{
- CompScreenPtr cs = GetCompScreen(pScreen);
- WindowPtr pRoot = pScreen->root;
- WindowPtr pWin;
- XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
- int result;
- int w = pScreen->width;
- int h = pScreen->height;
+ CompScreenPtr cs = GetCompScreen(pScreen);
+ WindowPtr pRoot = pScreen->root;
+ WindowPtr pWin;
+ XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */
+ int result;
+ int w = pScreen->width;
+ int h = pScreen->height;
#ifdef PANORAMIX
- if (!noPanoramiXExtension)
- {
- w = PanoramiXPixWidth;
- h = PanoramiXPixHeight;
+ if (!noPanoramiXExtension) {
+ w = PanoramiXPixWidth;
+ h = PanoramiXPixHeight;
}
#endif
- pWin = cs->pOverlayWin =
- CreateWindow (cs->overlayWid, pRoot, 0, 0, w, h, 0,
- InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
- pRoot->drawable.depth,
- serverClient, pScreen->rootVisual, &result);
+ pWin = cs->pOverlayWin =
+ CreateWindow(cs->overlayWid, pRoot, 0, 0, w, h, 0,
+ InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0],
+ pRoot->drawable.depth,
+ serverClient, pScreen->rootVisual, &result);
if (pWin == NULL)
- return FALSE;
+ return FALSE;
- if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer)pWin))
- return FALSE;
+ if (!AddResource(pWin->drawable.id, RT_WINDOW, (pointer) pWin))
+ return FALSE;
MapWindow(pWin, serverClient);
@@ -163,11 +161,10 @@ compCreateOverlayWindow (ScreenPtr pScreen)
* Destroy the overlay window
*/
void
-compDestroyOverlayWindow (ScreenPtr pScreen)
+compDestroyOverlayWindow(ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
cs->pOverlayWin = NullWindow;
- FreeResource (cs->overlayWid, RT_NONE);
+ FreeResource(cs->overlayWid, RT_NONE);
}
-