summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-27 19:31:22 -0700
committerThomas Hellstrom <thellstrom@vmware.com>2011-10-05 13:30:49 +0200
commit26845eb54a15d43f09288a87c5f74beac8fb6ec7 (patch)
tree89406cce6c97a44f5328300b58012e2f995d167a /src
parentb5438423ad29338429321cd29118a66b715cdcac (diff)
Use dixLookupWindow instead of LookupWindow on Xorg 1.5 & later
The LookupWindow function was deprecated in xserver commit ed75b056511ccb4 and removed during the Xorg 1.11 merge window by commit 82a8677d9175732. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'src')
-rw-r--r--src/vmwarexinerama.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/vmwarexinerama.c b/src/vmwarexinerama.c
index 371c7b1..2407c27 100644
--- a/src/vmwarexinerama.c
+++ b/src/vmwarexinerama.c
@@ -48,6 +48,26 @@
#include <xf86_libc.h>
#endif
+/*
+ * LookupWindow was removed with video abi 11.
+ */
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+#ifndef DixGetAttrAccess
+#define DixGetAttrAccess (1<<4)
+#endif
+#endif
+
+#if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 2)
+static inline int
+dixLookupWindow(WindowPtr *pWin, XID id, ClientPtr client, Mask access)
+{
+ *pWin = LookupWindow(id, client);
+ if (!*pWin)
+ return BadWindow;
+ return Success;
+}
+#endif
+
/*
*----------------------------------------------------------------------------
@@ -116,10 +136,12 @@ VMwareXineramaGetState(ClientPtr client)
ExtensionEntry *ext;
ScrnInfoPtr pScrn;
VMWAREPtr pVMWARE;
+ int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- pWin = LookupWindow(stuff->window, client);
- if(!pWin) return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) {
return BadMatch;
@@ -167,10 +189,12 @@ VMwareXineramaGetScreenCount(ClientPtr client)
ExtensionEntry *ext;
ScrnInfoPtr pScrn;
VMWAREPtr pVMWARE;
+ int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- pWin = LookupWindow(stuff->window, client);
- if(!pWin) return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) {
return BadMatch;
@@ -218,10 +242,12 @@ VMwareXineramaGetScreenSize(ClientPtr client)
ExtensionEntry *ext;
ScrnInfoPtr pScrn;
VMWAREPtr pVMWARE;
+ int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- pWin = LookupWindow (stuff->window, client);
- if(!pWin) return BadWindow;
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
if (!(ext = CheckExtension(PANORAMIX_PROTOCOL_NAME))) {
return BadMatch;