Merge branch 'master' into XACE-SELINUX
Conflicts: dix/devices.c
This commit is contained in:
commit
27612748e0
2049
GL/apple/indirect.c
2049
GL/apple/indirect.c
File diff suppressed because it is too large
Load Diff
12
Xi/allowev.c
12
Xi/allowev.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -103,10 +100,8 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||
|
||||
thisdev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (thisdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (thisdev == NULL)
|
||||
return BadDevice;
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
|
||||
switch (stuff->mode) {
|
||||
|
@ -129,9 +124,8 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
|||
AllowSome(client, time, thisdev, THAWED_BOTH);
|
||||
break;
|
||||
default:
|
||||
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadValue);
|
||||
client->errorValue = stuff->mode;
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
|
15
Xi/chgdctl.c
15
Xi/chgdctl.c
|
@ -56,14 +56,11 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
#include "XIstubs.h"
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "exevents.h"
|
||||
|
@ -153,11 +150,8 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
a = &dev->valuator->axes[r->first_valuator];
|
||||
for (i = 0; i < r->num_valuators; i++)
|
||||
if (*(resolution + i) < (a + i)->min_resolution ||
|
||||
*(resolution + i) > (a + i)->max_resolution) {
|
||||
SendErrorToClient(client, IReqCode,
|
||||
X_ChangeDeviceControl, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
*(resolution + i) > (a + i)->max_resolution)
|
||||
return BadValue;
|
||||
for (i = 0; i < r->num_valuators; i++)
|
||||
(a++)->resolution = *resolution++;
|
||||
|
||||
|
@ -269,11 +263,8 @@ out:
|
|||
|
||||
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
|
||||
}
|
||||
else {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, ret);
|
||||
}
|
||||
|
||||
return Success;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
179
Xi/chgfctl.c
179
Xi/chgfctl.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -119,9 +116,7 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
t = defaultKeyboardControl.click;
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
kctrl.click = t;
|
||||
}
|
||||
|
@ -132,9 +127,7 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
t = defaultKeyboardControl.bell;
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
kctrl.bell = t;
|
||||
}
|
||||
|
@ -145,9 +138,7 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
t = defaultKeyboardControl.bell_pitch;
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
kctrl.bell_pitch = t;
|
||||
}
|
||||
|
@ -158,9 +149,7 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
t = defaultKeyboardControl.bell_duration;
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
kctrl.bell_duration = t;
|
||||
}
|
||||
|
@ -174,15 +163,10 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
key = (KeyCode) f->key;
|
||||
if (key < 8 || key > 255) {
|
||||
client->errorValue = key;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
if (!(mask & DvAutoRepeatMode)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
if (!(mask & DvAutoRepeatMode))
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
if (mask & DvAutoRepeatMode) {
|
||||
|
@ -210,9 +194,7 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
(defaultKeyboardControl.autoRepeats[inx] & kmask);
|
||||
} else {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,9 +232,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
pctrl.num = defaultPointerControl.num;
|
||||
else if (accelNum < 0) {
|
||||
client->errorValue = accelNum;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
} else
|
||||
pctrl.num = accelNum;
|
||||
}
|
||||
|
@ -265,9 +245,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
pctrl.den = defaultPointerControl.den;
|
||||
else if (accelDenom <= 0) {
|
||||
client->errorValue = accelDenom;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
} else
|
||||
pctrl.den = accelDenom;
|
||||
}
|
||||
|
@ -280,9 +258,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
pctrl.threshold = defaultPointerControl.threshold;
|
||||
else if (threshold < 0) {
|
||||
client->errorValue = threshold;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
} else
|
||||
pctrl.threshold = threshold;
|
||||
}
|
||||
|
@ -341,21 +317,16 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
}
|
||||
}
|
||||
|
||||
if (f->num_keysyms > s->ctrl.max_symbols) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
if (f->num_keysyms > s->ctrl.max_symbols)
|
||||
return BadValue;
|
||||
|
||||
sup_syms = s->ctrl.symbols_supported;
|
||||
for (i = 0; i < f->num_keysyms; i++) {
|
||||
for (j = 0; j < s->ctrl.num_symbols_supported; j++)
|
||||
if (*(syms + i) == *(sup_syms + j))
|
||||
break;
|
||||
if (j == s->ctrl.num_symbols_supported) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (j == s->ctrl.num_symbols_supported)
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
s->ctrl.num_symbols_displayed = f->num_keysyms;
|
||||
|
@ -393,9 +364,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
t = defaultKeyboardControl.bell;
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
bctrl.percent = t;
|
||||
}
|
||||
|
@ -406,9 +375,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
t = defaultKeyboardControl.bell_pitch;
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
bctrl.pitch = t;
|
||||
}
|
||||
|
@ -419,9 +386,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
|||
t = defaultKeyboardControl.bell_duration;
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
bctrl.duration = t;
|
||||
}
|
||||
|
@ -485,38 +450,27 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
switch (stuff->feedbackid) {
|
||||
case KbdFeedbackClass:
|
||||
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != (sizeof(xKbdFeedbackCtl) >> 2))
|
||||
return BadLength;
|
||||
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeKbdFeedback(client, dev, stuff->mask, k,
|
||||
(xKbdFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangeKbdFeedback(client, dev, stuff->mask, k,
|
||||
(xKbdFeedbackCtl *) & stuff[1]);
|
||||
break;
|
||||
case PtrFeedbackClass:
|
||||
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != (sizeof(xPtrFeedbackCtl) >> 2))
|
||||
return BadLength;
|
||||
|
||||
for (p = dev->ptrfeed; p; p = p->next)
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangePtrFeedback(client, dev, stuff->mask, p,
|
||||
(xPtrFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangePtrFeedback(client, dev, stuff->mask, p,
|
||||
(xPtrFeedbackCtl *) & stuff[1]);
|
||||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
|
@ -526,63 +480,46 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
if (client->swapped) {
|
||||
swaps(&f->num_keysyms, n);
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms))
|
||||
return BadLength;
|
||||
|
||||
for (s = dev->stringfeed; s; s = s->next)
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeStringFeedback(client, dev, stuff->mask, s,
|
||||
(xStringFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangeStringFeedback(client, dev, stuff->mask, s,
|
||||
(xStringFeedbackCtl *) & stuff[1]);
|
||||
break;
|
||||
}
|
||||
case IntegerFeedbackClass:
|
||||
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != (sizeof(xIntegerFeedbackCtl) >> 2))
|
||||
return BadLength;
|
||||
|
||||
for (i = dev->intfeed; i; i = i->next)
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeIntegerFeedback(client, dev, stuff->mask, i,
|
||||
(xIntegerFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangeIntegerFeedback(client, dev, stuff->mask, i,
|
||||
(xIntegerFeedbackCtl *)&stuff[1]);
|
||||
break;
|
||||
case LedFeedbackClass:
|
||||
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != (sizeof(xLedFeedbackCtl) >> 2))
|
||||
return BadLength;
|
||||
|
||||
for (l = dev->leds; l; l = l->next)
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeLedFeedback(client, dev, stuff->mask, l,
|
||||
(xLedFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangeLedFeedback(client, dev, stuff->mask, l,
|
||||
(xLedFeedbackCtl *) & stuff[1]);
|
||||
break;
|
||||
case BellFeedbackClass:
|
||||
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (len != (sizeof(xBellFeedbackCtl) >> 2))
|
||||
return BadLength;
|
||||
|
||||
for (b = dev->bell; b; b = b->next)
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeBellFeedback(client, dev, stuff->mask, b,
|
||||
(xBellFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id)
|
||||
return ChangeBellFeedback(client, dev, stuff->mask, b,
|
||||
(xBellFeedbackCtl *) & stuff[1]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,14 +56,11 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "globals.h"
|
||||
#include "extnsionst.h"
|
||||
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -98,10 +95,8 @@ SProcXChangeKeyboardDevice(ClientPtr client)
|
|||
int
|
||||
ProcXChangeKeyboardDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
/* REQUEST(xChangeKeyboardDeviceReq); */
|
||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
||||
|
||||
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
return BadDevice;
|
||||
}
|
||||
|
|
14
Xi/chgkmap.c
14
Xi/chgkmap.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -111,18 +108,13 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceKeyMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
|
||||
|
||||
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
|
||||
stuff->firstKeyCode, stuff->keyCodes,
|
||||
stuff->keySymsPerKeyCode, (KeySym *) & stuff[1]);
|
||||
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceKeyMapping, 0, ret);
|
||||
return Success;
|
||||
return ret;
|
||||
}
|
||||
|
|
36
Xi/chgprop.c
36
Xi/chgprop.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
|
||||
#include "exevents.h"
|
||||
|
@ -115,30 +112,22 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
|
||||
if (stuff->length != (sizeof(xChangeDeviceDontPropagateListReq) >> 2) +
|
||||
stuff->count) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
|
||||
BadLength);
|
||||
return Success;
|
||||
}
|
||||
stuff->count)
|
||||
return BadLength;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
|
||||
rc);
|
||||
return Success;
|
||||
}
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (stuff->mode != AddToList && stuff->mode != DeleteFromList) {
|
||||
client->errorValue = stuff->window;
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
|
||||
BadMode);
|
||||
return Success;
|
||||
return BadMode;
|
||||
}
|
||||
|
||||
if (CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->count, tmp, NULL,
|
||||
X_ChangeDeviceDontPropagateList) != Success)
|
||||
return Success;
|
||||
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->count, tmp, NULL,
|
||||
X_ChangeDeviceDontPropagateList)) != Success)
|
||||
return rc;
|
||||
|
||||
others = wOtherInputMasks(pWin);
|
||||
if (!others && stuff->mode == DeleteFromList)
|
||||
|
@ -153,11 +142,8 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
|||
tmp[i].mask |= others->dontPropagateMask[i];
|
||||
|
||||
if (DeviceEventSuppressForWindow(pWin, client, tmp[i].mask, i) !=
|
||||
Success) {
|
||||
SendErrorToClient(client, IReqCode,
|
||||
X_ChangeDeviceDontPropagateList, 0, BadClass);
|
||||
return Success;
|
||||
}
|
||||
Success)
|
||||
return BadClass;
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
|
|
@ -56,8 +56,6 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
@ -65,7 +63,6 @@ SOFTWARE.
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
|
||||
#include "dixevents.h"
|
||||
|
@ -101,10 +98,8 @@ SProcXChangePointerDevice(ClientPtr client)
|
|||
int
|
||||
ProcXChangePointerDevice(ClientPtr client)
|
||||
{
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
/* REQUEST(xChangePointerDeviceReq); */
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
|
||||
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
return BadDevice;
|
||||
}
|
||||
|
|
|
@ -56,15 +56,12 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -151,10 +148,8 @@ ProcXCloseDevice(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||
|
||||
d = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (d == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (d == NULL)
|
||||
return BadDevice;
|
||||
|
||||
if (d->grab && SameClient(d->grab, client))
|
||||
(*d->DeactivateGrab) (d); /* release active grab */
|
||||
|
|
18
Xi/devbell.c
18
Xi/devbell.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -108,14 +105,12 @@ ProcXDeviceBell(ClientPtr client)
|
|||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
client->errorValue = stuff->deviceid;
|
||||
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadDevice);
|
||||
return Success;
|
||||
return BadDevice;
|
||||
}
|
||||
|
||||
if (stuff->percent < -100 || stuff->percent > 100) {
|
||||
client->errorValue = stuff->percent;
|
||||
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
if (stuff->feedbackclass == KbdFeedbackClass) {
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
|
@ -123,8 +118,7 @@ ProcXDeviceBell(ClientPtr client)
|
|||
break;
|
||||
if (!k) {
|
||||
client->errorValue = stuff->feedbackid;
|
||||
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
base = k->ctrl.bell;
|
||||
proc = k->BellProc;
|
||||
|
@ -136,8 +130,7 @@ ProcXDeviceBell(ClientPtr client)
|
|||
break;
|
||||
if (!b) {
|
||||
client->errorValue = stuff->feedbackid;
|
||||
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
base = b->ctrl.percent;
|
||||
proc = b->BellProc;
|
||||
|
@ -145,8 +138,7 @@ ProcXDeviceBell(ClientPtr client)
|
|||
class = BellFeedbackClass;
|
||||
} else {
|
||||
client->errorValue = stuff->feedbackclass;
|
||||
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
newpercent = (base * stuff->percent) / 100;
|
||||
if (stuff->percent < 0)
|
||||
|
|
|
@ -73,6 +73,10 @@ SOFTWARE.
|
|||
#include "dixgrabs.h" /* CreateGrab() */
|
||||
#include "scrnintstr.h"
|
||||
|
||||
#ifdef XKB
|
||||
#include "xkbsrv.h"
|
||||
#endif
|
||||
|
||||
#define WID(w) ((w) ? ((w)->drawable.id) : 0)
|
||||
#define AllModifiersMask ( \
|
||||
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
|
||||
|
@ -942,7 +946,7 @@ SetModifierMapping(ClientPtr client, DeviceIntPtr dev, int len, int rlen,
|
|||
}
|
||||
|
||||
void
|
||||
SendDeviceMappingNotify(CARD8 request,
|
||||
SendDeviceMappingNotify(ClientPtr client, CARD8 request,
|
||||
KeyCode firstKeyCode, CARD8 count, DeviceIntPtr dev)
|
||||
{
|
||||
xEvent event;
|
||||
|
@ -957,6 +961,11 @@ SendDeviceMappingNotify(CARD8 request,
|
|||
ev->count = count;
|
||||
}
|
||||
|
||||
#ifdef XKB
|
||||
if (request == MappingKeyboard || request == MappingModifier)
|
||||
XkbApplyMappingChange(dev, request, firstKeyCode, count, client);
|
||||
#endif
|
||||
|
||||
SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) ev, 1);
|
||||
}
|
||||
|
||||
|
@ -992,7 +1001,7 @@ ChangeKeyMapping(ClientPtr client,
|
|||
keysyms.map = map;
|
||||
if (!SetKeySymsMap(&k->curKeySyms, &keysyms))
|
||||
return BadAlloc;
|
||||
SendDeviceMappingNotify(MappingKeyboard, firstKeyCode, keyCodes, dev);
|
||||
SendDeviceMappingNotify(client, MappingKeyboard, firstKeyCode, keyCodes, dev);
|
||||
return client->noClientException;
|
||||
}
|
||||
|
||||
|
|
13
Xi/extinit.c
13
Xi/extinit.c
|
@ -58,8 +58,6 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include "inputstr.h"
|
||||
#include "gcstruct.h" /* pointer for extnsionst.h */
|
||||
#include "extnsionst.h" /* extension entry */
|
||||
|
@ -289,9 +287,7 @@ ProcIDispatch(ClientPtr client)
|
|||
return (ProcXGetDeviceControl(client));
|
||||
else if (stuff->data == X_ChangeDeviceControl)
|
||||
return (ProcXChangeDeviceControl(client));
|
||||
else {
|
||||
SendErrorToClient(client, IReqCode, stuff->data, 0, BadRequest);
|
||||
}
|
||||
|
||||
return (BadRequest);
|
||||
}
|
||||
|
||||
|
@ -378,9 +374,7 @@ SProcIDispatch(ClientPtr client)
|
|||
return (SProcXGetDeviceControl(client));
|
||||
else if (stuff->data == X_ChangeDeviceControl)
|
||||
return (SProcXChangeDeviceControl(client));
|
||||
else {
|
||||
SendErrorToClient(client, IReqCode, stuff->data, 0, BadRequest);
|
||||
}
|
||||
|
||||
return (BadRequest);
|
||||
}
|
||||
|
||||
|
@ -935,6 +929,8 @@ SEventIDispatch(xEvent * from, xEvent * to)
|
|||
DO_SWAP(SDeviceMappingNotifyEvent, deviceMappingNotify);
|
||||
else if (type == ChangeDeviceNotify)
|
||||
DO_SWAP(SChangeDeviceNotifyEvent, changeDeviceNotify);
|
||||
else if (type == DevicePresenceNotify)
|
||||
DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
|
||||
else {
|
||||
FatalError("XInputExtension: Impossible event!\n");
|
||||
}
|
||||
|
@ -980,6 +976,7 @@ XInputExtensionInit(void)
|
|||
EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
|
||||
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
|
||||
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
|
||||
EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
|
||||
} else {
|
||||
FatalError("IExtensionInit: AddExtensions failed\n");
|
||||
}
|
||||
|
|
18
Xi/getbmap.c
18
Xi/getbmap.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -106,18 +103,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
b = dev->button;
|
||||
if (b == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (b == NULL)
|
||||
return BadMatch;
|
||||
|
||||
rep.nElts = b->numButtons;
|
||||
rep.length = (rep.nElts + (4 - 1)) / 4;
|
||||
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
||||
|
|
39
Xi/getdctl.c
39
Xi/getdctl.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -250,10 +247,8 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetDeviceControl;
|
||||
|
@ -262,29 +257,20 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
|
||||
switch (stuff->control) {
|
||||
case DEVICE_RESOLUTION:
|
||||
if (!dev->valuator) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (!dev->valuator)
|
||||
return BadMatch;
|
||||
total_length = sizeof(xDeviceResolutionState) +
|
||||
(3 * sizeof(int) * dev->valuator->numAxes);
|
||||
break;
|
||||
case DEVICE_ABS_CALIB:
|
||||
if (!dev->absolute) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (!dev->absolute)
|
||||
return BadMatch;
|
||||
|
||||
total_length = sizeof(xDeviceAbsCalibCtl);
|
||||
break;
|
||||
case DEVICE_ABS_AREA:
|
||||
if (!dev->absolute) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (!dev->absolute)
|
||||
return BadMatch;
|
||||
|
||||
total_length = sizeof(xDeviceAbsAreaCtl);
|
||||
break;
|
||||
|
@ -295,15 +281,12 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
total_length = sizeof(xDeviceEnableCtl);
|
||||
break;
|
||||
default:
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
buf = (char *)xalloc(total_length);
|
||||
if (!buf) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
savbuf = buf;
|
||||
|
||||
switch (stuff->control) {
|
||||
|
|
21
Xi/getfctl.c
21
Xi/getfctl.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -308,10 +305,8 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetFeedbackControl;
|
||||
|
@ -345,16 +340,12 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
total_length += sizeof(xBellFeedbackState);
|
||||
}
|
||||
|
||||
if (total_length == 0) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (total_length == 0)
|
||||
return BadMatch;
|
||||
|
||||
buf = (char *)xalloc(total_length);
|
||||
if (!buf) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
savbuf = buf;
|
||||
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
|
|
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -101,10 +98,8 @@ ProcXGetDeviceFocus(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL || !dev->focus) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceFocus, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL || !dev->focus)
|
||||
return BadDevice;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetDeviceFocus;
|
||||
|
|
23
Xi/getkmap.c
23
Xi/getkmap.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
@ -102,29 +99,21 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if (dev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
if (dev->key == NULL)
|
||||
return BadMatch;
|
||||
k = &dev->key->curKeySyms;
|
||||
|
||||
if ((stuff->firstKeyCode < k->minKeyCode) ||
|
||||
(stuff->firstKeyCode > k->maxKeyCode)) {
|
||||
client->errorValue = stuff->firstKeyCode;
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
if (stuff->firstKeyCode + stuff->count > k->maxKeyCode + 1) {
|
||||
client->errorValue = stuff->count;
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue);
|
||||
return Success;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
|
|
18
Xi/getmmap.c
18
Xi/getmmap.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -102,18 +99,13 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceModifierMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
kp = dev->key;
|
||||
if (kp == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceModifierMapping, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (kp == NULL)
|
||||
return BadMatch;
|
||||
|
||||
maxkeys = kp->maxKeysPerModifier;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
|
|
10
Xi/getprop.c
10
Xi/getprop.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structs */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
@ -116,11 +113,8 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
|||
rep.count = 0;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
|
||||
rc);
|
||||
return Success;
|
||||
}
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if ((others = wOtherInputMasks(pWin)) != 0) {
|
||||
for (i = 0; i < EMASKSIZE; i++)
|
||||
|
|
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window struct */
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
@ -118,11 +115,8 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
|||
rep.all_clients_count = 0;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
|
||||
rc);
|
||||
return Success;
|
||||
}
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if ((pOthers = wOtherInputMasks(pWin)) != 0) {
|
||||
for (others = pOthers->inputClients; others; others = others->next)
|
||||
|
|
10
Xi/getvers.c
10
Xi/getvers.c
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -102,11 +99,8 @@ ProcXGetExtensionVersion(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||
|
||||
if (stuff->length != (sizeof(xGetExtensionVersionReq) +
|
||||
stuff->nbytes + 3) >> 2) {
|
||||
SendErrorToClient(client, IReqCode, X_GetExtensionVersion, 0,
|
||||
BadLength);
|
||||
return Success;
|
||||
}
|
||||
stuff->nbytes + 3) >> 2)
|
||||
return BadLength;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetExtensionVersion;
|
||||
|
|
49
Xi/grabdev.c
49
Xi/grabdev.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixevents.h" /* GrabDevice */
|
||||
|
@ -109,7 +106,7 @@ SProcXGrabDevice(ClientPtr client)
|
|||
int
|
||||
ProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
int error;
|
||||
int rc;
|
||||
xGrabDeviceReply rep;
|
||||
DeviceIntPtr dev;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
|
@ -117,10 +114,8 @@ ProcXGrabDevice(ClientPtr client)
|
|||
REQUEST(xGrabDeviceReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
||||
|
||||
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GrabDevice;
|
||||
|
@ -128,25 +123,22 @@ ProcXGrabDevice(ClientPtr client)
|
|||
rep.length = 0;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
if (CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->event_count, tmp, dev,
|
||||
X_GrabDevice) != Success)
|
||||
return Success;
|
||||
if ((rc = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->event_count, tmp, dev,
|
||||
X_GrabDevice)) != Success)
|
||||
return rc;
|
||||
|
||||
error = GrabDevice(client, dev, stuff->this_device_mode,
|
||||
stuff->other_devices_mode, stuff->grabWindow,
|
||||
stuff->ownerEvents, stuff->time,
|
||||
tmp[stuff->deviceid].mask, &rep.status);
|
||||
rc = GrabDevice(client, dev, stuff->this_device_mode,
|
||||
stuff->other_devices_mode, stuff->grabWindow,
|
||||
stuff->ownerEvents, stuff->time,
|
||||
tmp[stuff->deviceid].mask, &rep.status);
|
||||
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (error != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
|
||||
return Success;
|
||||
}
|
||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
@ -172,15 +164,12 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
|||
|
||||
for (i = 0; i < count; i++, list++) {
|
||||
device = *list >> 8;
|
||||
if (device > 255) {
|
||||
SendErrorToClient(client, IReqCode, req, 0, BadClass);
|
||||
if (device > 255)
|
||||
return BadClass;
|
||||
}
|
||||
|
||||
tdev = LookupDeviceIntRec(device);
|
||||
if (tdev == NULL || (dev != NULL && tdev != dev)) {
|
||||
SendErrorToClient(client, IReqCode, req, 0, BadClass);
|
||||
if (tdev == NULL || (dev != NULL && tdev != dev))
|
||||
return BadClass;
|
||||
}
|
||||
|
||||
for (j = 0; j < ExtEventIndex; j++)
|
||||
if (EventInfo[j].type == (*list & 0xff)) {
|
||||
|
|
|
@ -56,14 +56,11 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -117,28 +114,19 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
||||
|
||||
if (stuff->length !=
|
||||
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
|
@ -147,13 +135,11 @@ ProcXGrabDeviceButton(ClientPtr client)
|
|||
if ((ret = CreateMaskFromList(client, class,
|
||||
stuff->event_count, tmp, dev,
|
||||
X_GrabDeviceButton)) != Success)
|
||||
return Success;
|
||||
return ret;
|
||||
ret = GrabButton(client, dev, stuff->this_device_mode,
|
||||
stuff->other_devices_mode, stuff->modifiers, mdev,
|
||||
stuff->button, stuff->grabWindow, stuff->ownerEvents,
|
||||
(Cursor) 0, (Window) 0, tmp[stuff->grabbed_device].mask);
|
||||
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, ret);
|
||||
return (Success);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -56,14 +56,11 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -115,27 +112,19 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
REQUEST(xGrabDeviceKeyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
||||
|
||||
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count)
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
|
@ -144,17 +133,12 @@ ProcXGrabDeviceKey(ClientPtr client)
|
|||
if ((ret = CreateMaskFromList(client, class,
|
||||
stuff->event_count, tmp, dev,
|
||||
X_GrabDeviceKey)) != Success)
|
||||
return Success;
|
||||
return ret;
|
||||
|
||||
ret = GrabKey(client, dev, stuff->this_device_mode,
|
||||
stuff->other_devices_mode, stuff->modifiers, mdev,
|
||||
stuff->key, stuff->grabWindow, stuff->ownerEvents,
|
||||
tmp[stuff->grabbed_device].mask);
|
||||
|
||||
if (ret != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, ret);
|
||||
return Success;
|
||||
}
|
||||
|
||||
return Success;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -110,17 +107,11 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
|
||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
v = dev->valuator;
|
||||
if (v == NULL || v->numAxes == 0) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (v == NULL || v->numAxes == 0)
|
||||
return BadMatch;
|
||||
if (dev->valuator->motionHintWindow)
|
||||
MaybeStopDeviceHint(dev, client);
|
||||
axes = v->numAxes;
|
||||
|
@ -145,11 +136,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
size = sizeof(Time) + (axes * sizeof(INT32));
|
||||
tsize = num_events * size;
|
||||
coords = (INT32 *) ALLOCATE_LOCAL(tsize);
|
||||
if (!coords) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
|
||||
BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
if (!coords)
|
||||
return BadAlloc;
|
||||
rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */
|
||||
start.milliseconds, stop.milliseconds,
|
||||
(ScreenPtr) NULL);
|
||||
|
|
21
Xi/opendev.c
21
Xi/opendev.c
|
@ -56,14 +56,11 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -107,26 +104,20 @@ ProcXOpenDevice(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xOpenDeviceReq);
|
||||
|
||||
if (stuff->deviceid == inputInfo.pointer->id ||
|
||||
stuff->deviceid == inputInfo.keyboard->id) {
|
||||
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
stuff->deviceid == inputInfo.keyboard->id)
|
||||
return BadDevice;
|
||||
|
||||
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
|
||||
for (dev = inputInfo.off_devices; dev; dev = dev->next)
|
||||
if (dev->id == stuff->deviceid)
|
||||
break;
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
}
|
||||
|
||||
OpenInputDevice(dev, client, &status);
|
||||
if (status != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, status);
|
||||
return Success;
|
||||
}
|
||||
if (status != Success)
|
||||
return status;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_OpenDevice;
|
||||
|
|
15
Xi/queryst.c
15
Xi/queryst.c
|
@ -38,13 +38,10 @@ from The Open Group.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -100,10 +97,8 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
v = dev->valuator;
|
||||
if (v != NULL && v->motionHintWindow != NULL)
|
||||
|
@ -126,10 +121,8 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
num_classes++;
|
||||
}
|
||||
buf = (char *)xalloc(total_length);
|
||||
if (!buf) {
|
||||
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
if (!buf)
|
||||
return BadAlloc;
|
||||
savbuf = buf;
|
||||
|
||||
if (k != NULL) {
|
||||
|
|
|
@ -57,13 +57,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -164,40 +161,29 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
|||
REQUEST(xSelectExtensionEventReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
|
||||
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count) {
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
|
||||
BadLength);
|
||||
return Success;
|
||||
}
|
||||
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count)
|
||||
return BadLength;
|
||||
|
||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||
if (ret != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, ret);
|
||||
return Success;
|
||||
}
|
||||
if (ret != Success)
|
||||
return ret;
|
||||
|
||||
if (HandleDevicePresenceMask(client, pWin, (XEventClass *) & stuff[1],
|
||||
&stuff->count) != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
|
||||
BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
&stuff->count) != Success)
|
||||
return BadAlloc;
|
||||
|
||||
if ((ret = CreateMaskFromList(client, (XEventClass *) & stuff[1],
|
||||
stuff->count, tmp, NULL,
|
||||
X_SelectExtensionEvent)) != Success)
|
||||
return Success;
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < EMASKSIZE; i++)
|
||||
if (tmp[i].dev != NULL) {
|
||||
if ((ret =
|
||||
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
|
||||
tmp[i].mask, ExtExclusiveMasks[i],
|
||||
ExtValidMasks[i])) != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
|
||||
ret);
|
||||
return Success;
|
||||
}
|
||||
ExtValidMasks[i])) != Success)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return Success;
|
||||
|
|
|
@ -57,13 +57,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* Window */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -131,38 +128,29 @@ ProcXSendExtensionEvent(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
|
||||
if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
|
||||
(stuff->num_events * (sizeof(xEvent) >> 2))) {
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
(stuff->num_events * (sizeof(xEvent) >> 2)))
|
||||
return BadLength;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
/* The client's event type must be one defined by an extension. */
|
||||
|
||||
first = ((xEvent *) & stuff[1]);
|
||||
if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
|
||||
(first->u.u.type < lastEvent))) {
|
||||
(first->u.u.type < lastEvent)))
|
||||
client->errorValue = first->u.u.type;
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
return BadValue;
|
||||
|
||||
list = (XEventClass *) (first + stuff->num_events);
|
||||
if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
|
||||
X_SendExtensionEvent)) != Success)
|
||||
return Success;
|
||||
return ret;
|
||||
|
||||
ret = (SendEvent(client, dev, stuff->destination,
|
||||
stuff->propagate, (xEvent *) & stuff[1],
|
||||
tmp[stuff->deviceid].mask, stuff->num_events));
|
||||
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, ret);
|
||||
|
||||
return Success;
|
||||
return ret;
|
||||
}
|
||||
|
|
26
Xi/setbmap.c
26
Xi/setbmap.c
|
@ -59,13 +59,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -104,11 +101,8 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
||||
|
||||
if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) +
|
||||
stuff->map_length + 3) >> 2) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadLength);
|
||||
return Success;
|
||||
}
|
||||
stuff->map_length + 3) >> 2)
|
||||
return BadLength;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceButtonMapping;
|
||||
|
@ -117,24 +111,20 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
|||
rep.status = MappingSuccess;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
||||
|
||||
if (ret == BadValue || ret == BadMatch) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0, ret);
|
||||
return Success;
|
||||
} else {
|
||||
if (ret == BadValue || ret == BadMatch)
|
||||
return ret;
|
||||
else {
|
||||
rep.status = ret;
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
|
||||
}
|
||||
|
||||
if (ret != MappingBusy)
|
||||
SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
|
||||
SendDeviceMappingNotify(client, MappingPointer, 0, 0, dev);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
36
Xi/setdval.c
36
Xi/setdval.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -106,24 +103,17 @@ ProcXSetDeviceValuators(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) +
|
||||
stuff->num_valuators) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->valuator == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
stuff->num_valuators)
|
||||
return BadLength;
|
||||
|
||||
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
if (dev->valuator == NULL)
|
||||
return BadMatch;
|
||||
|
||||
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
|
||||
return BadValue;
|
||||
|
||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||
rep.status = AlreadyGrabbed;
|
||||
|
@ -133,11 +123,9 @@ ProcXSetDeviceValuators(ClientPtr client)
|
|||
stuff->num_valuators);
|
||||
|
||||
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
|
||||
rep.status);
|
||||
else
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
||||
return rep.status;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,8 +56,6 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
|
@ -65,7 +63,6 @@ SOFTWARE.
|
|||
|
||||
#include "dixevents.h"
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -106,15 +103,11 @@ ProcXSetDeviceFocus(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->device);
|
||||
if (dev == NULL || !dev->focus) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL || !dev->focus)
|
||||
return BadDevice;
|
||||
|
||||
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
||||
stuff->time, TRUE);
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, ret);
|
||||
|
||||
return Success;
|
||||
return ret;
|
||||
}
|
||||
|
|
19
Xi/setmmap.c
19
Xi/setmmap.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -103,11 +100,8 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceModifierMapping;
|
||||
|
@ -122,14 +116,11 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
||||
rep.success = ret;
|
||||
if (ret == MappingSuccess)
|
||||
SendDeviceMappingNotify(MappingModifier, 0, 0, dev);
|
||||
SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
||||
&rep);
|
||||
} else {
|
||||
if (ret == -1)
|
||||
ret = BadValue;
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0, ret);
|
||||
}
|
||||
} else if (ret == -1)
|
||||
return BadValue;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
21
Xi/setmode.c
21
Xi/setmode.c
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -105,14 +102,10 @@ ProcXSetDeviceMode(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->valuator == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
if (dev->valuator == NULL)
|
||||
return BadMatch;
|
||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||
rep.status = AlreadyGrabbed;
|
||||
else
|
||||
|
@ -120,10 +113,8 @@ ProcXSetDeviceMode(ClientPtr client)
|
|||
|
||||
if (rep.status == Success)
|
||||
dev->valuator->mode = stuff->mode;
|
||||
else if (rep.status != AlreadyGrabbed) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, rep.status);
|
||||
return Success;
|
||||
}
|
||||
else if (rep.status != AlreadyGrabbed)
|
||||
return rep.status;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
|
||||
return Success;
|
||||
|
|
|
@ -56,12 +56,9 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -102,10 +99,8 @@ ProcXUngrabDevice(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
grab = dev->grab;
|
||||
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
|
|
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
@ -111,41 +108,27 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->button == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
if (dev->button == NULL)
|
||||
return BadMatch;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, rc);
|
||||
return Success;
|
||||
}
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if ((stuff->modifiers != AnyModifier) &&
|
||||
(stuff->modifiers & ~AllModifiersMask)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
(stuff->modifiers & ~AllModifiersMask))
|
||||
return BadValue;
|
||||
|
||||
temporaryGrab.resource = client->clientAsMask;
|
||||
temporaryGrab.device = dev;
|
||||
|
|
|
@ -56,13 +56,10 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
@ -111,45 +108,32 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (dev == NULL)
|
||||
return BadDevice;
|
||||
if (dev->key == NULL)
|
||||
return BadMatch;
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
if (mdev == NULL)
|
||||
return BadDevice;
|
||||
if (mdev->key == NULL)
|
||||
return BadMatch;
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixUnknownAccess);
|
||||
if (rc != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, rc);
|
||||
return Success;
|
||||
}
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||
|
||||
(stuff->key < dev->key->curKeySyms.minKeyCode))
|
||||
&& (stuff->key != AnyKey)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
&& (stuff->key != AnyKey))
|
||||
return BadValue;
|
||||
|
||||
if ((stuff->modifiers != AnyModifier) &&
|
||||
(stuff->modifiers & ~AllModifiersMask)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
(stuff->modifiers & ~AllModifiersMask))
|
||||
return BadValue;
|
||||
|
||||
temporaryGrab.resource = client->clientAsMask;
|
||||
temporaryGrab.device = dev;
|
||||
|
|
|
@ -692,6 +692,9 @@ CompositeExtensionInit (void)
|
|||
ExtensionEntry *extEntry;
|
||||
int s;
|
||||
|
||||
/* Assume initialization is going to fail */
|
||||
noCompositeExtension = TRUE;
|
||||
|
||||
for (s = 0; s < screenInfo.numScreens; s++) {
|
||||
ScreenPtr pScreen = screenInfo.screens[s];
|
||||
VisualPtr vis;
|
||||
|
@ -748,4 +751,7 @@ CompositeExtensionInit (void)
|
|||
return;
|
||||
miRegisterRedirectBorderClipProc (compSetRedirectBorderClip,
|
||||
compGetRedirectBorderClip);
|
||||
|
||||
/* Initialization succeeded */
|
||||
noCompositeExtension = FALSE;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,8 @@ teardown(void)
|
|||
dbus_connection_unref(bus_info.connection);
|
||||
|
||||
RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, &bus_info);
|
||||
RemoveGeneralSocket(bus_info.fd);
|
||||
if (bus_info.fd != -1)
|
||||
RemoveGeneralSocket(bus_info.fd);
|
||||
bus_info.fd = -1;
|
||||
bus_info.connection = NULL;
|
||||
|
||||
|
|
18
configure.ac
18
configure.ac
|
@ -69,6 +69,12 @@ dnl Check for dtrace program (needed to build Xserver dtrace probes)
|
|||
AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
|
||||
[Enable dtrace probes (default: enabled if dtrace found)]),
|
||||
[WDTRACE=$withval], [WDTRACE=auto])
|
||||
dnl Darwin 9 has dtrace, but it doesn't support compilation into ELF...
|
||||
if test "x$WDTRACE" = xauto; then
|
||||
case $host_os in
|
||||
darwin*) WDTRACE="no" ;;
|
||||
esac
|
||||
fi
|
||||
if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
|
||||
AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
|
||||
if test "x$DTRACE" = "xnot_found" ; then
|
||||
|
@ -493,7 +499,6 @@ AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes exten
|
|||
AC_ARG_ENABLE(xtrap, AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
|
||||
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
|
||||
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
|
||||
AC_ARG_ENABLE(quartz, AS_HELP_STRING([--enable-quartz], [Build with darwin quartz support (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
|
||||
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
|
||||
AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
|
||||
AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
|
||||
|
@ -516,7 +521,7 @@ AC_ARG_ENABLE(evi, AS_HELP_STRING([--disable-evi], [Build Extended-Vi
|
|||
AC_ARG_ENABLE(multibuffer, AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
|
||||
AC_ARG_ENABLE(fontcache, AS_HELP_STRING([--enable-fontcache], [Build FontCache extension (default: disabled)]), [FONTCACHE=$enableval], [FONTCACHE=no])
|
||||
AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
|
||||
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
|
||||
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=auto])
|
||||
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
|
||||
AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
|
||||
AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
|
||||
|
@ -528,6 +533,9 @@ AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (d
|
|||
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
|
||||
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||
AC_ARG_ENABLE(xdarwin, AS_HELP_STRING([--enable-xdarwin], [Build XDarwin server (default: auto)]), [XDARWIN=$enableval], [XDARWIN=auto])
|
||||
AC_ARG_ENABLE(xdarwinapp, AS_HELP_STRING([--enable-xdarwinapp], [Build XDarwin.app server (default: no)]), [XDARWINAPP=$enableval], [XDARWINAPP=no])
|
||||
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--disable-xquartz], [Build Xquartz server on Darwin (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
|
||||
AC_ARG_ENABLE(x11app, AS_HELP_STRING([--enable-x11app], [Build Apple's X11.app wrapper for Xquartz (default: no)]), [X11APP=$enableval], [X11APP=no])
|
||||
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
|
||||
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no])
|
||||
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
|
||||
|
@ -1757,6 +1765,10 @@ return 0;}
|
|||
AC_MSG_NOTICE([Disabling XF86VidMode extension])
|
||||
XF86VIDMODE=no
|
||||
fi
|
||||
if test "x$XF86BIGFONT" = xyes || test "x$XF86BIGFONT" = xauto; then
|
||||
AC_MSG_NOTICE([Disabling XF86BigFont extension])
|
||||
XF86BIGFONT=no
|
||||
fi
|
||||
if test "x$DGA" = xyes || test "x$DGA" = xauto; then
|
||||
AC_MSG_NOTICE([Disabling DGA extension])
|
||||
DGA=no
|
||||
|
@ -1776,7 +1788,9 @@ _AM_DEPENDENCIES([OBJC])
|
|||
AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
|
||||
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
|
||||
AM_CONDITIONAL(XDARWIN, [test "x$XDARWIN" = xyes])
|
||||
AM_CONDITIONAL(XDARWINAPP, [test "x$XDARWINAPP" = xyes])
|
||||
AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
|
||||
|
||||
dnl kdrive DDX
|
||||
|
||||
XEPHYR_LIBS=
|
||||
|
|
|
@ -1194,10 +1194,9 @@ SendMappingNotify(unsigned request, unsigned firstKeyCode, unsigned count,
|
|||
}
|
||||
#ifdef XKB
|
||||
if (!noXkbExtension &&
|
||||
((request == MappingKeyboard) || (request == MappingModifier))) {
|
||||
XkbApplyMappingChange(inputInfo.keyboard,request,firstKeyCode,count,
|
||||
client);
|
||||
}
|
||||
((request == MappingKeyboard) || (request == MappingModifier)))
|
||||
XkbApplyMappingChange(inputInfo.keyboard, request, firstKeyCode, count,
|
||||
client);
|
||||
#endif
|
||||
|
||||
/* 0 is the server client */
|
||||
|
@ -1348,6 +1347,7 @@ int
|
|||
ProcSetModifierMapping(ClientPtr client)
|
||||
{
|
||||
xSetModifierMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
int rc;
|
||||
REQUEST(xSetModifierMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
|
||||
|
@ -1365,8 +1365,10 @@ ProcSetModifierMapping(ClientPtr client)
|
|||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
/* FIXME: Send mapping notifies for all the extended devices as well. */
|
||||
SendMappingNotify(MappingModifier, 0, 0, client);
|
||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||
if (dev->key && dev->coreEvents)
|
||||
SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
|
||||
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
|
||||
return client->noClientException;
|
||||
}
|
||||
|
@ -1437,16 +1439,19 @@ ProcChangeKeyboardMapping(ClientPtr client)
|
|||
keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1;
|
||||
keysyms.mapWidth = stuff->keySymsPerKeyCode;
|
||||
keysyms.map = (KeySym *)&stuff[1];
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key)
|
||||
if (!SetKeySymsMap(&pDev->key->curKeySyms, &keysyms))
|
||||
return BadAlloc;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: Send mapping notifies for all the extended devices as well. */
|
||||
SendMappingNotify(MappingKeyboard, stuff->firstKeyCode, stuff->keyCodes,
|
||||
client);
|
||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next)
|
||||
if (pDev->key && pDev->coreEvents)
|
||||
SendDeviceMappingNotify(client, MappingKeyboard,
|
||||
stuff->firstKeyCode, stuff->keyCodes,
|
||||
pDev);
|
||||
|
||||
return client->noClientException;
|
||||
}
|
||||
|
||||
|
|
|
@ -402,6 +402,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
|
|||
if (!events)
|
||||
return 0;
|
||||
|
||||
/* DO NOT WANT */
|
||||
if (type != KeyPress && type != KeyRelease)
|
||||
return 0;
|
||||
|
||||
|
@ -409,6 +410,9 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type,
|
|||
(pDev->coreEvents && !inputInfo.keyboard->key))
|
||||
return 0;
|
||||
|
||||
if (key_code < 8 || key_code > 255)
|
||||
return 0;
|
||||
|
||||
if (pDev->coreEvents)
|
||||
numEvents = 2;
|
||||
else
|
||||
|
|
67
exa/exa.c
67
exa/exa.c
|
@ -277,6 +277,26 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
|
|||
REGION_NULL(pScreen, &pExaPixmap->validSys);
|
||||
REGION_NULL(pScreen, &pExaPixmap->validFB);
|
||||
|
||||
/* Check whether this pixmap can be used for acceleration. */
|
||||
pExaPixmap->accel_blocked = 0;
|
||||
|
||||
if (pExaScr->info->maxPitchPixels) {
|
||||
int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
|
||||
|
||||
if (pExaPixmap->fb_pitch > max_pitch)
|
||||
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
||||
}
|
||||
|
||||
if (pExaScr->info->maxPitchBytes &&
|
||||
pExaPixmap->fb_pitch > pExaScr->info->maxPitchBytes)
|
||||
pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
|
||||
|
||||
if (w > pExaScr->info->maxX)
|
||||
pExaPixmap->accel_blocked |= EXA_RANGE_WIDTH;
|
||||
|
||||
if (h > pExaScr->info->maxY)
|
||||
pExaPixmap->accel_blocked |= EXA_RANGE_HEIGHT;
|
||||
|
||||
return pPixmap;
|
||||
}
|
||||
|
||||
|
@ -659,6 +679,17 @@ exaDriverInit (ScreenPtr pScreen,
|
|||
if (!pScreenInfo)
|
||||
return FALSE;
|
||||
|
||||
if (pScreenInfo->exa_major != EXA_VERSION_MAJOR ||
|
||||
pScreenInfo->exa_minor > EXA_VERSION_MINOR)
|
||||
{
|
||||
LogMessage(X_ERROR, "EXA(%d): driver's EXA version requirements "
|
||||
"(%d.%d) are incompatible with EXA version (%d.%d)\n",
|
||||
pScreen->myNum,
|
||||
pScreenInfo->exa_major, pScreenInfo->exa_minor,
|
||||
EXA_VERSION_MAJOR, EXA_VERSION_MINOR);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pScreenInfo->memoryBase) {
|
||||
LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memoryBase must be "
|
||||
"non-zero\n", pScreen->myNum);
|
||||
|
@ -695,14 +726,36 @@ exaDriverInit (ScreenPtr pScreen,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (pScreenInfo->exa_major != EXA_VERSION_MAJOR ||
|
||||
pScreenInfo->exa_minor > EXA_VERSION_MINOR)
|
||||
/* If the driver doesn't set any max pitch values, we'll just assume
|
||||
* that there's a limitation by pixels, and that it's the same as
|
||||
* maxX.
|
||||
*/
|
||||
if (!pScreenInfo->maxPitchPixels && !pScreenInfo->maxPitchBytes)
|
||||
{
|
||||
LogMessage(X_ERROR, "EXA(%d): driver's EXA version requirements "
|
||||
"(%d.%d) are incompatible with EXA version (%d.%d)\n",
|
||||
pScreen->myNum,
|
||||
pScreenInfo->exa_major, pScreenInfo->exa_minor,
|
||||
EXA_VERSION_MAJOR, EXA_VERSION_MINOR);
|
||||
pScreenInfo->maxPitchPixels = pScreenInfo->maxX;
|
||||
}
|
||||
|
||||
/* If set, maxPitchPixels must not be smaller than maxX. */
|
||||
if (pScreenInfo->maxPitchPixels &&
|
||||
pScreenInfo->maxPitchPixels < pScreenInfo->maxX)
|
||||
{
|
||||
LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::maxPitchPixels "
|
||||
"is smaller than ExaDriverRec::maxX\n",
|
||||
pScreen->myNum);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* If set, maxPitchBytes must not be smaller than maxX * 4.
|
||||
* This is to ensure that a 32bpp pixmap with the maximum width
|
||||
* can be handled wrt the pitch.
|
||||
*/
|
||||
if (pScreenInfo->maxPitchBytes &&
|
||||
pScreenInfo->maxPitchBytes < (pScreenInfo->maxX * 4))
|
||||
{
|
||||
LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::maxPitchBytes "
|
||||
"doesn't allow a 32bpp pixmap with width equal to "
|
||||
"ExaDriverRec::maxX\n",
|
||||
pScreen->myNum);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
33
exa/exa.h
33
exa/exa.h
|
@ -39,7 +39,7 @@
|
|||
#include "fb.h"
|
||||
|
||||
#define EXA_VERSION_MAJOR 2
|
||||
#define EXA_VERSION_MINOR 2
|
||||
#define EXA_VERSION_MINOR 3
|
||||
#define EXA_VERSION_RELEASE 0
|
||||
|
||||
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
||||
|
@ -671,6 +671,37 @@ typedef struct _ExaDriver {
|
|||
*/
|
||||
#define EXA_PREPARE_MASK 2
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* maxPitchPixels controls the pitch limitation for rendering from
|
||||
* the card.
|
||||
* The driver should never receive a request for rendering a pixmap
|
||||
* that has a pitch (in pixels) beyond maxPitchPixels.
|
||||
*
|
||||
* Setting this field is optional -- if your hardware doesn't have
|
||||
* a pitch limitation in pixels, don't set this. If neither this value
|
||||
* nor maxPitchBytes is set, then maxPitchPixels is set to maxX.
|
||||
* If set, it must not be smaller than maxX.
|
||||
*
|
||||
* @sa maxPitchBytes
|
||||
*/
|
||||
int maxPitchPixels;
|
||||
|
||||
/**
|
||||
* maxPitchBytes controls the pitch limitation for rendering from
|
||||
* the card.
|
||||
* The driver should never receive a request for rendering a pixmap
|
||||
* that has a pitch (in bytes) beyond maxPitchBytes.
|
||||
*
|
||||
* Setting this field is optional -- if your hardware doesn't have
|
||||
* a pitch limitation in bytes, don't set this.
|
||||
* If set, it must not be smaller than maxX * 4.
|
||||
* There's no default value for maxPitchBytes.
|
||||
*
|
||||
* @sa maxPitchPixels
|
||||
*/
|
||||
int maxPitchBytes;
|
||||
|
||||
/** @} */
|
||||
} ExaDriverRec, *ExaDriverPtr;
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|||
ScreenPtr pScreen = pDrawable->pScreen;
|
||||
ExaScreenPriv (pScreen);
|
||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||
PixmapPtr pPixmap;
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||
ExaPixmapPriv (pPixmap);
|
||||
BoxPtr pextent, pbox;
|
||||
int nbox;
|
||||
int extentX1, extentX2, extentY1, extentY2;
|
||||
|
@ -54,13 +55,12 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||
pixmaps[0].pPix = pPixmap;
|
||||
pixmaps[0].pReg = NULL;
|
||||
|
||||
if (pExaScr->swappedOut ||
|
||||
pGC->fillStyle != FillSolid ||
|
||||
pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
pExaPixmap->accel_blocked)
|
||||
{
|
||||
ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted);
|
||||
return;
|
||||
|
@ -480,6 +480,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
{
|
||||
ExaScreenPriv (pDstDrawable->pScreen);
|
||||
PixmapPtr pSrcPixmap, pDstPixmap;
|
||||
ExaPixmapPrivPtr pSrcExaPixmap, pDstExaPixmap;
|
||||
int src_off_x, src_off_y;
|
||||
int dst_off_x, dst_off_y;
|
||||
ExaMigrationRec pixmaps[2];
|
||||
|
@ -527,14 +528,14 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|||
pixmaps[1].pPix = pSrcPixmap;
|
||||
pixmaps[1].pReg = NULL;
|
||||
|
||||
/* Respect maxX/maxY in a trivial way: don't set up drawing when we might
|
||||
* violate the limits. The proper solution would be a temporary pixmap
|
||||
* adjusted so that the drawing happened within limits.
|
||||
pSrcExaPixmap = ExaGetPixmapPriv (pSrcPixmap);
|
||||
pDstExaPixmap = ExaGetPixmapPriv (pDstPixmap);
|
||||
|
||||
/* Check whether the accelerator can use this pixmap.
|
||||
* FIXME: If it cannot, use temporary pixmaps so that the drawing
|
||||
* happens within limits.
|
||||
*/
|
||||
if (pSrcPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pSrcPixmap->drawable.height > pExaScr->info->maxY ||
|
||||
pDstPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pDstPixmap->drawable.height > pExaScr->info->maxY)
|
||||
if (pSrcExaPixmap->accel_blocked || pDstExaPixmap->accel_blocked)
|
||||
{
|
||||
goto fallback;
|
||||
} else {
|
||||
|
@ -760,6 +761,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|||
ExaScreenPriv (pDrawable->pScreen);
|
||||
RegionPtr pClip = fbGetCompositeClip(pGC);
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
||||
ExaPixmapPriv (pPixmap);
|
||||
register BoxPtr pbox;
|
||||
BoxPtr pextent;
|
||||
int extentX1, extentX2, extentY1, extentY2;
|
||||
|
@ -786,9 +788,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|||
|
||||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||
|
||||
if (pExaScr->swappedOut ||
|
||||
pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
if (pExaScr->swappedOut || pExaPixmap->accel_blocked)
|
||||
{
|
||||
goto fallback;
|
||||
}
|
||||
|
@ -1102,21 +1102,21 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
|||
CARD32 alu)
|
||||
{
|
||||
ExaScreenPriv(pDrawable->pScreen);
|
||||
PixmapPtr pPixmap;
|
||||
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||
ExaPixmapPriv (pPixmap);
|
||||
int xoff, yoff;
|
||||
ExaMigrationRec pixmaps[1];
|
||||
|
||||
pixmaps[0].as_dst = TRUE;
|
||||
pixmaps[0].as_src = FALSE;
|
||||
pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
||||
pixmaps[0].pPix = pPixmap;
|
||||
pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid,
|
||||
alu) ? NULL : pRegion;
|
||||
|
||||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||
REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
|
||||
|
||||
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY)
|
||||
if (pExaPixmap->accel_blocked)
|
||||
{
|
||||
goto fallback;
|
||||
} else {
|
||||
|
@ -1193,6 +1193,8 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
{
|
||||
ExaScreenPriv(pDrawable->pScreen);
|
||||
PixmapPtr pPixmap;
|
||||
ExaPixmapPrivPtr pExaPixmap;
|
||||
ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile);
|
||||
int xoff, yoff, tileXoff, tileYoff;
|
||||
int tileWidth, tileHeight;
|
||||
ExaMigrationRec pixmaps[2];
|
||||
|
@ -1223,10 +1225,9 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||
REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
|
||||
|
||||
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
||||
pPixmap->drawable.height > pExaScr->info->maxY ||
|
||||
tileWidth > pExaScr->info->maxX ||
|
||||
tileHeight > pExaScr->info->maxY)
|
||||
pExaPixmap = ExaGetPixmapPriv (pPixmap);
|
||||
|
||||
if (pExaPixmap->accel_blocked || pTileExaPixmap->accel_blocked)
|
||||
{
|
||||
goto fallback;
|
||||
} else {
|
||||
|
|
|
@ -154,6 +154,10 @@ extern DevPrivateKey exaPixmapPrivateKey;
|
|||
#define ExaSetPixmapPriv(p,a) dixSetPrivate(&(p)->devPrivates, exaPixmapPrivateKey, a)
|
||||
#define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
|
||||
|
||||
#define EXA_RANGE_PITCH (1 << 0)
|
||||
#define EXA_RANGE_WIDTH (1 << 1)
|
||||
#define EXA_RANGE_HEIGHT (1 << 2)
|
||||
|
||||
typedef struct {
|
||||
ExaOffscreenArea *area;
|
||||
int score; /**< score for the move-in vs move-out heuristic */
|
||||
|
@ -166,6 +170,17 @@ typedef struct {
|
|||
int fb_pitch; /**< pitch of pixmap in framebuffer memory */
|
||||
unsigned int fb_size; /**< size of pixmap in framebuffer memory */
|
||||
|
||||
/**
|
||||
* Holds information about whether this pixmap can be used for
|
||||
* acceleration (== 0) or not (> 0).
|
||||
*
|
||||
* Contains a OR'ed combination of the following values:
|
||||
* EXA_RANGE_PITCH - set if the pixmap's pitch is out of range
|
||||
* EXA_RANGE_WIDTH - set if the pixmap's width is out of range
|
||||
* EXA_RANGE_HEIGHT - set if the pixmap's height is out of range
|
||||
*/
|
||||
unsigned int accel_blocked;
|
||||
|
||||
/**
|
||||
* The damage record contains the areas of the pixmap's current location
|
||||
* (framebuffer or system) that have been damaged compared to the other
|
||||
|
|
|
@ -336,24 +336,28 @@ exaTryDriverComposite(CARD8 op,
|
|||
int nbox;
|
||||
int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
|
||||
PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
|
||||
ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix;
|
||||
struct _Pixmap scratch;
|
||||
ExaMigrationRec pixmaps[3];
|
||||
|
||||
pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
|
||||
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
|
||||
if (pMask)
|
||||
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
|
||||
pSrcExaPix = ExaGetPixmapPriv(pSrcPix);
|
||||
|
||||
/* Bail if we might exceed coord limits by rendering from/to these. We
|
||||
* should really be making some scratch pixmaps with offsets and coords
|
||||
* adjusted to deal with this, but it hasn't been done yet.
|
||||
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
|
||||
pDstExaPix = ExaGetPixmapPriv(pDstPix);
|
||||
|
||||
if (pMask) {
|
||||
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
|
||||
pMaskExaPix = ExaGetPixmapPriv(pMaskPix);
|
||||
}
|
||||
|
||||
/* Check whether the accelerator can use these pixmaps.
|
||||
* FIXME: If it cannot, use temporary pixmaps so that the drawing
|
||||
* happens within limits.
|
||||
*/
|
||||
if (pSrcPix->drawable.width > pExaScr->info->maxX ||
|
||||
pSrcPix->drawable.height > pExaScr->info->maxY ||
|
||||
pDstPix->drawable.width > pExaScr->info->maxX ||
|
||||
pDstPix->drawable.height > pExaScr->info->maxY ||
|
||||
(pMask && (pMaskPix->drawable.width > pExaScr->info->maxX ||
|
||||
pMaskPix->drawable.height > pExaScr->info->maxY)))
|
||||
if (pSrcExaPix->accel_blocked ||
|
||||
pDstExaPix->accel_blocked ||
|
||||
(pMask && (pMaskExaPix->accel_blocked)))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@ -380,7 +384,6 @@ exaTryDriverComposite(CARD8 op,
|
|||
width, height))
|
||||
return 1;
|
||||
|
||||
pDstPix = exaGetDrawablePixmap (pDst->pDrawable);
|
||||
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
|
||||
|
||||
REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y);
|
||||
|
@ -391,12 +394,12 @@ exaTryDriverComposite(CARD8 op,
|
|||
pixmaps[0].pReg = pixmaps[0].as_src ? NULL : ®ion;
|
||||
pixmaps[1].as_dst = FALSE;
|
||||
pixmaps[1].as_src = TRUE;
|
||||
pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||
pixmaps[1].pPix = pSrcPix;
|
||||
pixmaps[1].pReg = NULL;
|
||||
if (pMask) {
|
||||
pixmaps[2].as_dst = FALSE;
|
||||
pixmaps[2].as_src = TRUE;
|
||||
pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable);
|
||||
pixmaps[2].pPix = pMaskPix;
|
||||
pixmaps[2].pReg = NULL;
|
||||
exaDoMigration(pixmaps, 3, TRUE);
|
||||
} else {
|
||||
|
|
|
@ -8,27 +8,35 @@ INCLUDES = @XORG_INCS@ -I../../miext/rootless
|
|||
DEFS = @DEFS@ -DUSE_NEW_CLUT
|
||||
|
||||
if XQUARTZ
|
||||
XQUARTZ_SUBDIRS = bundle quartz
|
||||
XQUARTZ_SUBDIRS = quartz
|
||||
XQUARTZ_PROGS = Xquartz
|
||||
XQUARTZ_HOOK = xquartz-install-hook
|
||||
endif
|
||||
|
||||
if XDARWINAPP
|
||||
XDARWINAPP_SUBDIRS = bundle
|
||||
XDARWINAPP_HOOK = xdarwinapp-install-hook
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
iokit \
|
||||
$(XQUARTZ_SUBDIRS) \
|
||||
$(XDARWINAPP_SUBDIRS) \
|
||||
utils \
|
||||
.
|
||||
|
||||
darwinappdir = @APPLE_APPLICATIONS_DIR@/XDarwin.app
|
||||
|
||||
libdarwinShared_a_SOURCES = darwin.c \
|
||||
darwinEvents.c \
|
||||
darwinKeyboard.c \
|
||||
$(darwin_XINPUT_SRCS)
|
||||
|
||||
bin_PROGRAMS = XDarwin Xquartz
|
||||
XDarwin_SOURCES = \
|
||||
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||
$(top_srcdir)/mi/miinitext.c \
|
||||
$(top_srcdir)/Xi/stubs.c
|
||||
# bin_PROGRAMS = XDarwin Xquartz
|
||||
bin_PROGRAMS = $(XQUARTZ_PROGS)
|
||||
|
||||
#XDarwin_SOURCES = \
|
||||
# $(top_srcdir)/fb/fbcmap_mi.c \
|
||||
# $(top_srcdir)/mi/miinitext.c \
|
||||
# $(top_srcdir)/Xi/stubs.c
|
||||
|
||||
Xquartz_SOURCES = \
|
||||
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||
|
@ -68,22 +76,22 @@ DARWIN_LIBS = \
|
|||
./libdarwinShared.a \
|
||||
$(XSERVER_LIBS)
|
||||
|
||||
XDARWIN_LIBS = \
|
||||
$(DARWIN_LIBS) \
|
||||
./iokit/libiokit.a
|
||||
#XDARWIN_LIBS = \
|
||||
# $(DARWIN_LIBS) \
|
||||
# ./iokit/libiokit.a
|
||||
XQUARTZ_LIBS = \
|
||||
$(DARWIN_LIBS)
|
||||
|
||||
XDarwin_DEPENDENCIES = $(XDARWIN_LIBS)
|
||||
XDarwin_LDADD = $(XDARWIN_LIBS) $(XSERVER_SYS_LIBS)
|
||||
#XDarwin_DEPENDENCIES = $(XDARWIN_LIBS)
|
||||
#XDarwin_LDADD = $(XDARWIN_LIBS) $(XSERVER_SYS_LIBS)
|
||||
|
||||
Xquartz_DEPENDENCIES = $(XQUARTZ_LIBS)
|
||||
Xquartz_LDADD = $(XQUARTZ_LIBS) $(XSERVER_SYS_LIBS) -lXplugin
|
||||
|
||||
XDarwin_LDFLAGS = \
|
||||
-XCClinker -Objc \
|
||||
-Wl,-u,_miDCInitialize \
|
||||
-Wl,-framework,IOKit
|
||||
#XDarwin_LDFLAGS = \
|
||||
# -XCClinker -Objc \
|
||||
# -Wl,-u,_miDCInitialize \
|
||||
# -Wl,-framework,IOKit
|
||||
|
||||
Xquartz_LDFLAGS = \
|
||||
-XCClinker -Objc \
|
||||
|
@ -95,19 +103,23 @@ Xquartz_LDFLAGS = \
|
|||
-Wl,-framework,CoreAudio \
|
||||
-Wl,-framework,IOKit
|
||||
|
||||
XDarwin_CFLAGS = -DINXDARWIN
|
||||
#XDarwin_CFLAGS = -DINXDARWIN
|
||||
Xquartz_CFLAGS = -DINXQUARTZ -DHAS_CG_MACH_PORT -DHAS_KL_API -DHAVE_XORG_CONFIG_H
|
||||
|
||||
if XQUARTZ
|
||||
macosdir = $(darwinappdir)/Contents/MacOS
|
||||
|
||||
DEFS += -DDARWIN_WITH_QUARTZ -DXFree86Server
|
||||
|
||||
macos_PROGRAMS = XDarwinApp
|
||||
macos_SCRIPTS = x11app
|
||||
bin_SCRIPTS = x11app
|
||||
|
||||
x11app:
|
||||
cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
|
||||
endif
|
||||
|
||||
if XDARWINAPP
|
||||
macosdir = $(darwinappdir)/Contents/MacOS
|
||||
|
||||
macos_PROGRAMS = XDarwinApp
|
||||
darwinappdir = @APPLE_APPLICATIONS_DIR@/XDarwin.app
|
||||
|
||||
XDarwinApp_SOURCES = \
|
||||
$(top_srcdir)/fb/fbcmap_mi.c \
|
||||
|
@ -134,8 +146,6 @@ XDarwinApp_LDFLAGS = \
|
|||
-Wl,-framework,IOKit
|
||||
|
||||
XDarwinApp_CFLAGS = -DINXDARWINAPP
|
||||
HOOK_TARGETS = xquartz-install-hook
|
||||
|
||||
|
||||
crplugindir = $(darwinappdir)/Contents/Resources/cr.bundle/Contents/MacOS
|
||||
crplugin_LTLIBRARIES = cr.la
|
||||
|
@ -190,7 +200,6 @@ glxMesa_la_LDFLAGS = -shrext '' \
|
|||
glxMesa_la_DEPENDENCIES = XDarwinApp
|
||||
endif
|
||||
|
||||
endif
|
||||
if HAVE_XPLUGIN
|
||||
|
||||
xprplugindir = $(darwinappdir)/Contents/Resources/xpr.bundle/Contents/MacOS
|
||||
|
@ -254,18 +263,21 @@ glxAGL_la_DEPENDENCIES = XDarwinApp
|
|||
|
||||
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
man1_MANS = XDarwin.man
|
||||
#man1_MANS = XDarwin.man
|
||||
|
||||
uninstall-hook:
|
||||
rm -rf $(DESTDIR)$(macosdir)/XDarwin
|
||||
#uninstall-hook:
|
||||
# rm -rf $(DESTDIR)$(macosdir)/XDarwin
|
||||
|
||||
install-data-hook: $(HOOK_TARGETS)
|
||||
install-data-hook: $(XQUARTZ_HOOK) $(XDARWINAPP_HOOK)
|
||||
|
||||
xquartz-install-hook:
|
||||
xquartz-install-hook::
|
||||
cd apple && xcodebuild install CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
|
||||
|
||||
xdarwinapp-install hook:
|
||||
mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin
|
||||
cd apple && xcodebuild install
|
||||
|
||||
EXTRA_DIST = \
|
||||
darwin.c \
|
||||
|
|
|
@ -4,42 +4,6 @@
|
|||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>x11app</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>X11.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>X11 Application</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>****</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSIsAppleDefaultForType</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>tool</string>
|
||||
<string>*</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>UNIX Application</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>****</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>X11</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
|
@ -57,7 +21,7 @@
|
|||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<string>x11a</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
|
|
@ -79,7 +79,7 @@ extern void X11ApplicationMain (int argc, const char *argv[],
|
|||
extern int X11EnableKeyEquivalents;
|
||||
extern int quartzHasRoot, quartzEnableRootless;
|
||||
|
||||
#define APP_PREFS "com.apple.x11"
|
||||
#define APP_PREFS "org.x.x11"
|
||||
|
||||
#define PREFS_APPSMENU "apps_menu"
|
||||
#define PREFS_FAKEBUTTONS "enable_fake_buttons"
|
||||
|
|
|
@ -41,13 +41,11 @@
|
|||
# include "micmap.h"
|
||||
#undef BOOL
|
||||
|
||||
//#include "xf86Version.h"
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define DEFAULTS_FILE "/etc/X11/xserver/Xquartz.plist"
|
||||
#define DEFAULTS_FILE "/usr/X11/lib/X11xserver/Xquartz.plist"
|
||||
|
||||
int X11EnableKeyEquivalents = TRUE;
|
||||
int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
|
||||
|
@ -275,9 +273,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
|||
_appFlags._active = YES;
|
||||
|
||||
[self activateX:YES];
|
||||
#ifdef DARWIN_DDX_MISSING
|
||||
if ([e data2] & 0x10) QuartzMessageServerThread (kXDarwinBringAllToFront, 0);
|
||||
#endif
|
||||
if ([e data2] & 0x10) X11ApplicationSetFrontProcess();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -38,14 +38,12 @@
|
|||
|
||||
/* ouch! */
|
||||
#define BOOL X_BOOL
|
||||
//# include "Xproto.h"
|
||||
#include "opaque.h"
|
||||
# include "darwin.h"
|
||||
# include "../quartz/quartz.h"
|
||||
# define _APPLEWM_SERVER_
|
||||
# include "X11/extensions/applewm.h"
|
||||
# include "../quartz/applewmExt.h"
|
||||
//# include "X.h"
|
||||
#undef BOOL
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -301,6 +299,7 @@
|
|||
int child1, child2 = 0;
|
||||
int status;
|
||||
|
||||
/* this old code doesn't work with csh ...
|
||||
shell = getenv("SHELL");
|
||||
if (shell == NULL) shell = "/bin/bash";
|
||||
|
||||
|
@ -308,8 +307,14 @@
|
|||
argv[1] = "-l";
|
||||
argv[2] = "-c";
|
||||
argv[3] = command;
|
||||
argv[4] = NULL;
|
||||
|
||||
argv[4] = NULL;
|
||||
... but the new code doesn't work with spaces in a command :(
|
||||
*/
|
||||
|
||||
argv[0] = "/usr/bin/login";
|
||||
argv[1] = "-fp";
|
||||
argv[2] = getlogin();
|
||||
|
||||
/* Do the fork-twice trick to avoid having to reap zombies */
|
||||
|
||||
child1 = fork();
|
||||
|
@ -655,7 +660,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
|
|||
|
||||
- (IBAction) x11_help:sender
|
||||
{
|
||||
AHLookupAnchor (CFSTR ("Mac Help"), CFSTR ("mchlp2276"));
|
||||
AHLookupAnchor ((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR ("mchlp2276"));
|
||||
}
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem *)item
|
||||
|
|
|
@ -70,14 +70,16 @@
|
|||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xauth.h>
|
||||
|
||||
#ifdef USE_XCB
|
||||
#include <xcb/xcb.h>
|
||||
#endif
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <SystemConfiguration/SystemConfiguration.h>
|
||||
|
||||
#define X_SERVER "/usr/X11/bin/Xquartz"
|
||||
#define XTERM_PATH "/usr/X11/bin/xterm"
|
||||
#define WM_PATH "/usr/X11/bin/quartz-wm"
|
||||
#define DEFAULT_XINITRC "/etc/X11/xinit/xinitrc"
|
||||
#define WM_PATH "/usr/bin/quartz-wm"
|
||||
#define DEFAULT_XINITRC "/usr/X11/lib/X11/xinit/xinitrc"
|
||||
#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
|
||||
|
||||
/* what xinit does */
|
||||
|
@ -595,37 +597,25 @@ static Boolean
|
|||
display_exists_p (int number)
|
||||
{
|
||||
char buf[64];
|
||||
void *conn;
|
||||
char *fullname = NULL;
|
||||
int idisplay, iscreen;
|
||||
char *conn_auth_name, *conn_auth_data;
|
||||
int conn_auth_namelen, conn_auth_datalen;
|
||||
#ifdef USE_XTRANS_INTERNALS
|
||||
extern void *_X11TransConnectDisplay ();
|
||||
extern void _XDisconnectDisplay ();
|
||||
#endif
|
||||
#ifdef USE_XCB
|
||||
xcb_connection_t *conn;
|
||||
#endif
|
||||
|
||||
/* Since connecting to the display waits for a few seconds if the
|
||||
display doesn't exist, check for trivial non-existence - if the
|
||||
socket in /tmp exists or not.. (note: if the socket exists, the
|
||||
server may still not, so we need to try to connect in that case..) */
|
||||
|
||||
sprintf (buf, "/tmp/.X11-unix/X%d", number);
|
||||
if (access (buf, F_OK) != 0)
|
||||
return FALSE;
|
||||
#ifdef USE_XTRANS_INTERNALS
|
||||
/* This is a private function that we shouldn't really be calling,
|
||||
but it's the best way to see if the server exists (without
|
||||
needing to hold the necessary authentication to use it) */
|
||||
|
||||
if (access (buf, F_OK) != 0) return FALSE;
|
||||
|
||||
#ifdef USE_XCB
|
||||
sprintf (buf, ":%d", number);
|
||||
conn = _X11TransConnectDisplay (buf, &fullname, &idisplay, &iscreen,
|
||||
&conn_auth_name, &conn_auth_namelen,
|
||||
&conn_auth_data, &conn_auth_datalen);
|
||||
if (conn == NULL)
|
||||
return FALSE;
|
||||
|
||||
_XDisconnectDisplay (conn);
|
||||
conn = xcb_connect(buf, NULL);
|
||||
if (conn == NULL) return FALSE;
|
||||
xcb_disconnect(conn);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,7 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
|
|
@ -34,9 +34,7 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
#if HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
|
|
|
@ -58,9 +58,8 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
#if HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "cursorstr.h"
|
||||
#include "mipointrst.h"
|
||||
|
|
|
@ -29,10 +29,7 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
|
||||
#if HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "darwin.h"
|
||||
#include "darwinKeyboard.h"
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
* authorization.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#import "quartzCommon.h"
|
||||
|
||||
#define BOOL xBOOL
|
||||
|
|
|
@ -35,10 +35,8 @@
|
|||
* authorization.
|
||||
*/
|
||||
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.3 2004/07/30 19:12:17 torrey Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.19 2003/11/24 05:39:01 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
#include "quartzCommon.h"
|
||||
|
||||
#define BOOL xBOOL
|
||||
|
|
|
@ -24,9 +24,9 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
|
||||
#define NEED_REPLIES
|
||||
|
|
|
@ -30,11 +30,10 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/XView.m,v 1.1 2003/06/07 05:49:07 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#import "XView.h"
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#import "XView.h"
|
||||
|
||||
@implementation XView
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "quartz/cr/cr.h"
|
||||
|
||||
|
|
|
@ -28,10 +28,9 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "quartz/cr/cr.h"
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crScreen.m,v 1.5 2003/11/12 20:21:52 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "quartz/cr/cr.h"
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "darwin.h"
|
||||
#include "quartz/quartz.h"
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "quartz/quartzCursor.h"
|
||||
#include "darwin.h"
|
||||
|
|
|
@ -34,9 +34,9 @@ Equipment Corporation.
|
|||
******************************************************************/
|
||||
|
||||
#include "pseudoramiX.h"
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "dixstruct.h"
|
||||
#include "window.h"
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
#include "quartz.h"
|
||||
#include "darwin.h"
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
#include "quartzAudio.h"
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.5 2004/06/08 22:58:10 torrey Exp $ */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
#include "quartzCursor.h"
|
||||
#include "darwin.h"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Code to build a keymap using the Carbon Keyboard Layout API,
|
||||
which is supported on Mac OS X 10.2 and newer.
|
||||
|
||||
Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
|
||||
Copyright (c) 2003, 2007 Apple Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
|
@ -32,11 +32,9 @@
|
|||
prior written authorization.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include "quartzCommon.h"
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzCommon.h"
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
|
@ -216,35 +214,45 @@ Bool
|
|||
DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
|
||||
{
|
||||
KeyboardLayoutRef key_layout;
|
||||
const void *chr_data;
|
||||
const void *chr_data = NULL;
|
||||
int num_keycodes = NUM_KEYCODES;
|
||||
UInt32 keyboard_type = 0;
|
||||
int is_uchr, i, j;
|
||||
OSStatus err;
|
||||
KeySym *k;
|
||||
|
||||
KLGetCurrentKeyboardLayout (&key_layout);
|
||||
KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
|
||||
|
||||
TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource();
|
||||
if (currentKeyLayoutRef)
|
||||
{
|
||||
CFDataRef currentKeyLayoutDataRef = (CFDataRef )TISGetInputSourceProperty(currentKeyLayoutRef, kTISPropertyUnicodeKeyLayoutData);
|
||||
if (currentKeyLayoutDataRef)
|
||||
chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef);
|
||||
}
|
||||
|
||||
if (chr_data != NULL)
|
||||
{
|
||||
is_uchr = 1;
|
||||
keyboard_type = LMGetKbdType ();
|
||||
KLGetCurrentKeyboardLayout (&key_layout);
|
||||
KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
|
||||
|
||||
if (chr_data != NULL)
|
||||
{
|
||||
is_uchr = 1;
|
||||
keyboard_type = LMGetKbdType ();
|
||||
}
|
||||
else
|
||||
{
|
||||
KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
|
||||
|
||||
if (chr_data == NULL)
|
||||
{
|
||||
ErrorF ( "Couldn't get uchr or kchr resource\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
is_uchr = 0;
|
||||
num_keycodes = 128;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
|
||||
|
||||
if (chr_data == NULL)
|
||||
{
|
||||
ErrorF ( "Couldn't get uchr or kchr resource\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
is_uchr = 0;
|
||||
num_keycodes = 128;
|
||||
}
|
||||
|
||||
|
||||
/* Scan the keycode range for the Unicode character that each
|
||||
key produces in the four shift states. Then convert that to
|
||||
|
@ -369,6 +377,8 @@ DarwinModeReadSystemKeymap (darwinKeyboardInfo *info)
|
|||
}
|
||||
}
|
||||
|
||||
if(currentKeyLayoutRef) CFRelease(currentKeyLayoutRef);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,9 @@
|
|||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include "quartzPasteboard.h"
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartzPasteboard.h"
|
||||
#include <X11/Xatom.h>
|
||||
#include "windowstr.h"
|
||||
#include "propertyst.h"
|
||||
|
|
|
@ -35,9 +35,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
#include <dix-config.h>
|
||||
|
||||
#define NEED_REPLIES
|
||||
#define NEED_EVENTS
|
||||
#include <X11/X.h>
|
||||
|
|
|
@ -33,9 +33,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
* Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
copyright holders shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software without
|
||||
prior written authorization. */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "x-hash.h"
|
||||
#include "x-list.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
copyright holders shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software without
|
||||
prior written authorization. */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "x-hook.h"
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
copyright holders shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software without
|
||||
prior written authorization. */
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "x-list.h"
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "xpr.h"
|
||||
#include "quartz/applewmExt.h"
|
||||
#include "rootless.h"
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "xpr.h"
|
||||
#include "darwin.h"
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "xpr.h"
|
||||
#include "rootlessCommon.h"
|
||||
#include "Xplugin.h"
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||
* use or other dealings in this Software without prior written authorization.
|
||||
*/
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "quartz/quartzCommon.h"
|
||||
#include "quartz/quartz.h"
|
||||
#include "xpr.h"
|
||||
|
|
|
@ -308,7 +308,7 @@ ephyrDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst,
|
|||
KdScreenInfo *screen = pScreenPriv->screen;
|
||||
EphyrScrPriv *scrpriv = screen->driver;
|
||||
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
|
||||
char *src;
|
||||
unsigned char *src;
|
||||
int src_pitch, cpp;
|
||||
|
||||
if (pSrc->drawable.bitsPerPixel < 8)
|
||||
|
@ -345,7 +345,7 @@ ephyrUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src,
|
|||
KdScreenInfo *screen = pScreenPriv->screen;
|
||||
EphyrScrPriv *scrpriv = screen->driver;
|
||||
EphyrFakexaPriv *fakexa = scrpriv->fakexa;
|
||||
char *dst;
|
||||
unsigned char *dst;
|
||||
int dst_pitch, cpp;
|
||||
|
||||
if (pDst->drawable.bitsPerPixel < 8)
|
||||
|
|
|
@ -225,22 +225,6 @@ void
|
|||
DarwinHandleGUI(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
void GlxExtensionInit();
|
||||
void GlxWrapInitVisuals(void *procPtr);
|
||||
|
||||
void
|
||||
DarwinGlxExtensionInit()
|
||||
{
|
||||
GlxExtensionInit();
|
||||
}
|
||||
|
||||
void
|
||||
DarwinGlxWrapInitVisuals(
|
||||
void *procPtr)
|
||||
{
|
||||
GlxWrapInitVisuals(procPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
|
|
|
@ -190,7 +190,14 @@
|
|||
|
||||
|
||||
/* EDID Ver. >= 1.2 */
|
||||
#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0)
|
||||
/**
|
||||
* Returns true if the pointer is the start of a monitor descriptor block
|
||||
* instead of a detailed timing descriptor.
|
||||
*
|
||||
* Checking the reserved pad fields for zeroes fails on some monitors with
|
||||
* broken empty ASCII strings. Only the first two bytes are reliable.
|
||||
*/
|
||||
#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0)
|
||||
#define IS_MONITOR_DESC _IS_MONITOR_DESC(c)
|
||||
#define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000
|
||||
#define PIXEL_CLOCK _PIXEL_CLOCK(c)
|
||||
|
|
|
@ -2220,7 +2220,10 @@ xf86_covering_crtc(ScrnInfoPtr pScrn,
|
|||
|
||||
/*
|
||||
* For overlay video, compute the relevant CRTC and
|
||||
* clip video to that
|
||||
* clip video to that.
|
||||
*
|
||||
* returning FALSE means there was a memory failure of some kind,
|
||||
* not that the video shouldn't be displayed
|
||||
*/
|
||||
|
||||
_X_EXPORT Bool
|
||||
|
|
|
@ -127,22 +127,6 @@ void
|
|||
DarwinHandleGUI(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
void GlxExtensionInit();
|
||||
void GlxWrapInitVisuals(void *procPtr);
|
||||
|
||||
void
|
||||
DarwinGlxExtensionInit()
|
||||
{
|
||||
GlxExtensionInit();
|
||||
}
|
||||
|
||||
void
|
||||
DarwinGlxWrapInitVisuals(
|
||||
void *procPtr)
|
||||
{
|
||||
GlxWrapInitVisuals(procPtr);
|
||||
}
|
||||
#endif
|
||||
|
||||
void OsVendorInit()
|
||||
|
|
|
@ -129,6 +129,7 @@ extern int SetModifierMapping(
|
|||
KeyClassPtr * /* k */);
|
||||
|
||||
extern void SendDeviceMappingNotify(
|
||||
ClientPtr /* client, */,
|
||||
CARD8 /* request, */,
|
||||
KeyCode /* firstKeyCode */,
|
||||
CARD8 /* count */,
|
||||
|
|
24
os/utils.c
24
os/utils.c
|
@ -285,7 +285,8 @@ OsSignal(sig, handler)
|
|||
sigaddset(&act.sa_mask, sig);
|
||||
act.sa_flags = 0;
|
||||
act.sa_handler = handler;
|
||||
sigaction(sig, &act, &oact);
|
||||
if (sigaction(sig, &act, &oact))
|
||||
perror("sigaction");
|
||||
return oact.sa_handler;
|
||||
#endif
|
||||
}
|
||||
|
@ -1684,6 +1685,10 @@ System(char *command)
|
|||
|
||||
#ifdef SIGCHLD
|
||||
csig = signal(SIGCHLD, SIG_DFL);
|
||||
if (csig == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -1708,7 +1713,10 @@ System(char *command)
|
|||
}
|
||||
|
||||
#ifdef SIGCHLD
|
||||
signal(SIGCHLD, csig);
|
||||
if (signal(SIGCHLD, csig) == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return p == -1 ? -1 : status;
|
||||
|
@ -1745,13 +1753,18 @@ Popen(char *command, char *type)
|
|||
|
||||
/* Ignore the smart scheduler while this is going on */
|
||||
old_alarm = signal(SIGALRM, SIG_IGN);
|
||||
if (old_alarm == SIG_ERR) {
|
||||
perror("signal");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (pid = fork()) {
|
||||
case -1: /* error */
|
||||
close(pdes[0]);
|
||||
close(pdes[1]);
|
||||
xfree(cur);
|
||||
signal(SIGALRM, old_alarm);
|
||||
if (signal(SIGALRM, old_alarm) == SIG_ERR)
|
||||
perror("signal");
|
||||
return NULL;
|
||||
case 0: /* child */
|
||||
if (setgid(getgid()) == -1)
|
||||
|
@ -1927,7 +1940,10 @@ Pclose(pointer iop)
|
|||
/* allow EINTR again */
|
||||
OsReleaseSignals ();
|
||||
|
||||
signal(SIGALRM, old_alarm);
|
||||
if (old_alarm && signal(SIGALRM, old_alarm) == SIG_ERR) {
|
||||
perror("signal");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return pid == -1 ? -1 : pstat;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue