summaryrefslogtreecommitdiff
path: root/xserver/dix
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-01-31 07:52:37 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-01-31 07:52:37 +0000
commit1a90d395ebb1b3caf5c698b358d34ca6bbe775aa (patch)
treeb06881e6e0859ab79faf35af2fdae7b717c42071 /xserver/dix
parent973e4e72b90a98f23aa855f0c68b8ce8686cfb03 (diff)
Update to xserver 1.11.4. tested by krw@, shadchin@.
Diffstat (limited to 'xserver/dix')
-rw-r--r--xserver/dix/dispatch.c33
-rw-r--r--xserver/dix/dixutils.c7
-rw-r--r--xserver/dix/events.c2
-rw-r--r--xserver/dix/extension.c14
4 files changed, 24 insertions, 32 deletions
diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c
index f8200b188..316384abc 100644
--- a/xserver/dix/dispatch.c
+++ b/xserver/dix/dispatch.c
@@ -337,8 +337,6 @@ DisableLimitedSchedulingLatency(void)
SmartScheduleLatencyLimited = 0;
}
-#define MAJOROP ((xReq *)client->requestBuffer)->reqType
-
void
Dispatch(void)
{
@@ -419,22 +417,33 @@ Dispatch(void)
}
client->sequence++;
+ client->majorOp = ((xReq *)client->requestBuffer)->reqType;
+ client->minorOp = 0;
+ if (client->majorOp >= EXTENSION_BASE) {
+ ExtensionEntry *ext = GetExtensionEntry(client->majorOp);
+ if (ext)
+ client->minorOp = ext->MinorOpcode(client);
+ }
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_START(LookupMajorName(MAJOROP), MAJOROP,
- ((xReq *)client->requestBuffer)->length,
- client->index, client->requestBuffer);
+ if (XSERVER_REQUEST_START_ENABLED())
+ XSERVER_REQUEST_START(LookupMajorName(client->majorOp),
+ client->majorOp,
+ ((xReq *)client->requestBuffer)->length,
+ client->index, client->requestBuffer);
#endif
if (result > (maxBigRequestSize << 2))
result = BadLength;
else {
- result = XaceHookDispatch(client, MAJOROP);
+ result = XaceHookDispatch(client, client->majorOp);
if (result == Success)
- result = (* client->requestVector[MAJOROP])(client);
+ result = (* client->requestVector[client->majorOp])(client);
XaceHookAuditEnd(client, result);
}
#ifdef XSERVER_DTRACE
- XSERVER_REQUEST_DONE(LookupMajorName(MAJOROP), MAJOROP,
- client->sequence, client->index, result);
+ if (XSERVER_REQUEST_DONE_ENABLED())
+ XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp),
+ client->majorOp, client->sequence,
+ client->index, result);
#endif
if (client->noClientException != Success)
@@ -444,8 +453,8 @@ Dispatch(void)
}
else if (result != Success)
{
- SendErrorToClient(client, MAJOROP,
- MinorOpcodeOfRequest(client),
+ SendErrorToClient(client, client->majorOp,
+ client->minorOp,
client->errorValue, result);
break;
}
@@ -466,8 +475,6 @@ Dispatch(void)
SmartScheduleLatencyLimited = 0;
}
-#undef MAJOROP
-
static int VendorRelease = VENDOR_RELEASE;
static char *VendorString = VENDOR_NAME;
diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c
index 1e3134663..cfb03974d 100644
--- a/xserver/dix/dixutils.c
+++ b/xserver/dix/dixutils.c
@@ -202,13 +202,12 @@ dixLookupDrawable(DrawablePtr *pDraw, XID id, ClientPtr client,
int rc;
*pDraw = NULL;
- client->errorValue = id;
-
- if (id == INVALID)
- return BadDrawable;
rc = dixLookupResourceByClass((pointer *)&pTmp, id, RC_DRAWABLE, client, access);
+ if (rc != Success)
+ client->errorValue = id;
+
if (rc == BadValue)
return BadDrawable;
if (rc != Success)
diff --git a/xserver/dix/events.c b/xserver/dix/events.c
index 8e7f9c324..7d2d0e3ee 100644
--- a/xserver/dix/events.c
+++ b/xserver/dix/events.c
@@ -1356,7 +1356,7 @@ ScreenRestructured (ScreenPtr pScreen)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
{
- if (!DevHasCursor(pDev))
+ if (!IsFloating(pDev) && !DevHasCursor(pDev))
continue;
/* GrabDevice doesn't have a confineTo field, so we don't need to
diff --git a/xserver/dix/extension.c b/xserver/dix/extension.c
index 2db5695f3..d595b8057 100644
--- a/xserver/dix/extension.c
+++ b/xserver/dix/extension.c
@@ -230,20 +230,6 @@ StandardMinorOpcode(ClientPtr client)
return ((xReq *)client->requestBuffer)->data;
}
-unsigned short
-MinorOpcodeOfRequest(ClientPtr client)
-{
- unsigned char major;
-
- major = ((xReq *)client->requestBuffer)->reqType;
- if (major < EXTENSION_BASE)
- return 0;
- major -= EXTENSION_BASE;
- if (major >= NumExtensions)
- return 0;
- return (*extensions[major]->MinorOpcode)(client);
-}
-
void
CloseDownExtensions(void)
{