aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/dispatch.c19
-rw-r--r--xorg-server/dix/events.c9
2 files changed, 18 insertions, 10 deletions
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 0ce10c2f7..2df1a6ea5 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -3499,14 +3499,16 @@ ProcInitialConnection(ClientPtr client)
REQUEST(xReq);
xConnClientPrefix *prefix;
int whichbyte = 1;
+ char order;
- prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq);
- if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
- return client->noClientException = -1;
- if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
- (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) {
- client->swapped = TRUE;
- SwapConnClientPrefix(prefix);
+ prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq);
+ order = prefix->byteOrder;
+ if (order != 'l' && order != 'B' && order != 'r' && order != 'R')
+ return client->noClientException = -1;
+ if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) ||
+ (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) {
+ client->swapped = TRUE;
+ SwapConnClientPrefix(prefix);
}
stuff->reqType = 2;
stuff->length += bytes_to_int32(prefix->nbytesAuthProto) +
@@ -3514,6 +3516,9 @@ ProcInitialConnection(ClientPtr client)
if (client->swapped) {
swaps(&stuff->length);
}
+ if (order == 'r' || order == 'R') {
+ client->local = FALSE;
+ }
ResetCurrentRequest(client);
return Success;
}
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index 3b40446bc..c0e330b85 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -1555,11 +1555,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
WindowPtr oldWin;
/* slave devices need to float for the duration of the grab. */
- if (grab->grabtype == XI2 &&
+ if (grab->grabtype == XI2 && keybd->enabled &&
!(passive & ImplicitGrabMask) && !IsMaster(keybd))
DetachFromMaster(keybd);
- if (grabinfo->grab)
+ if (!keybd->enabled)
+ oldWin = NULL;
+ else if (grabinfo->grab)
oldWin = grabinfo->grab->window;
else if (keybd->focus)
oldWin = keybd->focus->win;
@@ -1569,7 +1571,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time,
oldWin = keybd->focus->win;
if (keybd->valuator)
keybd->valuator->motionHintWindow = NullWindow;
- DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
+ if (oldWin)
+ DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
if (syncEvents.playingEvents)
grabinfo->grabTime = syncEvents.time;
else