aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-12-03 00:00:03 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 14:58:17 +0200
commit92589f41a1d1df9fcd2d33a97199f015b5482d67 (patch)
tree56f6ccabf208c53e3cdc801775d474b153aa2087
parentb4b0a1a775b324c85ecf1361cb87e5e275cf0108 (diff)
downloadnx-libs-92589f41a1d1df9fcd2d33a97199f015b5482d67.tar.gz
nx-libs-92589f41a1d1df9fcd2d33a97199f015b5482d67.tar.bz2
nx-libs-92589f41a1d1df9fcd2d33a97199f015b5482d67.zip
NXshm.c: cleanup nxagent_fbShmCreatePixmap
... to match it as closely as possible to the upstream version.
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXshm.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
index 4784f4657..e72a37494 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c
@@ -389,7 +389,7 @@ ProcShmPutImage(client)
return (client->noClientException);
}
-
+/* derived from Xext/shm.c */
static PixmapPtr
nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr)
ScreenPtr pScreen;
@@ -400,29 +400,22 @@ nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr)
{
register PixmapPtr pPixmap;
+#ifdef NXAGENT_SERVER
pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth, 0);
-
+#else
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
+#endif
if (!pPixmap)
{
- return NullPixmap;
+ return NullPixmap;
}
- #if defined(NXAGENT_SERVER) && defined(TEST)
- fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d] Hint[%d]\n", width, height, depth, 0);
- #endif
-
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
BitsPerPixel(depth), PixmapBytePad(width, depth), (void *)addr))
{
- #if defined(NXAGENT_SERVER) && defined(WARNING)
- fprintf(stderr,"fbShmCreatePixmap: Return Null Pixmap.\n");
- #endif
-
- (*pScreen->DestroyPixmap)(pPixmap);
-
- return NullPixmap;
+ (*pScreen->DestroyPixmap)(pPixmap);
+ return NullPixmap;
}
-
return pPixmap;
}
@@ -434,14 +427,24 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
int depth;
char *addr;
{
- PixmapPtr result;
+ #ifdef TEST
+ fprintf(stderr, "%s: Width [%d] Height [%d] Depth [%d] Hint[%d]\n", __func__,
+ width, height, depth, 0);
+ #endif
nxagentShmPixmapTrap = True;
- result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
+ PixmapPtr result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
nxagentShmPixmapTrap = False;
+ #ifdef WARNING
+ if (result == NullPixmap)
+ {
+ fprintf(stderr, "%s: Return Null Pixmap.\n", __func__);
+ }
+ #endif
+
return result;
}