summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c11
-rw-r--r--dix/dispatch.c28
-rw-r--r--dix/dixfonts.c8
-rw-r--r--dix/dixutils.c21
-rw-r--r--dix/getevents.c19
-rw-r--r--dix/globals.c2
-rw-r--r--dix/main.c9
-rw-r--r--dix/property.c16
-rw-r--r--dix/resource.c5
-rw-r--r--dix/window.c13
10 files changed, 52 insertions, 80 deletions
diff --git a/dix/devices.c b/dix/devices.c
index f036985de..61b3b66af 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -743,7 +743,6 @@ FreeDeviceClass(int type, pointer *class)
xfree((*p));
break;
}
-
}
*class = NULL;
}
@@ -1623,7 +1622,7 @@ DoSetModifierMapping(ClientPtr client, KeyCode *inputMap,
}
}
- rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (rc != Success)
return rc;
@@ -1762,7 +1761,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (rc != Success)
return rc;
}
@@ -1797,7 +1796,7 @@ DoSetPointerMapping(ClientPtr client, DeviceIntPtr device, BYTE *map, int n)
for (dev = inputInfo.devices; dev; dev = dev->next) {
if ((dev->coreEvents || dev == inputInfo.pointer) && dev->button) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
if (rc != Success)
return rc;
}
@@ -2142,7 +2141,7 @@ ProcChangeKeyboardControl (ClientPtr client)
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
if ((pDev->coreEvents || pDev == inputInfo.keyboard) &&
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
- ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixSetAttrAccess);
+ ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (ret != Success)
return ret;
}
@@ -2298,7 +2297,7 @@ ProcChangePointerControl(ClientPtr client)
for (mouse = inputInfo.devices; mouse; mouse = mouse->next) {
if ((mouse->coreEvents || mouse == inputInfo.pointer) &&
mouse->ptrfeed && mouse->ptrfeed->CtrlProc) {
- rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixSetAttrAccess);
+ rc = XaceHook(XACE_DEVICE_ACCESS, client, mouse, DixManageAccess);
if (rc != Success)
return rc;
}
diff --git a/dix/dispatch.c b/dix/dispatch.c
index c7043ea8e..199c66b2f 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -417,17 +417,18 @@ Dispatch(void)
}
isItTimeToYield = FALSE;
+#ifdef XPRINT
requestingClient = client;
+#endif
#ifdef SMART_SCHEDULE
start_tick = SmartScheduleTime;
#endif
while (!isItTimeToYield)
{
if (*icheck[0] != *icheck[1])
- {
ProcessInputEvents();
- FlushIfCriticalOutputPending();
- }
+
+ FlushIfCriticalOutputPending();
#ifdef SMART_SCHEDULE
if (!SmartScheduleDisable &&
(SmartScheduleTime - start_tick) >= SmartScheduleSlice)
@@ -483,9 +484,6 @@ Dispatch(void)
client->errorValue, result);
break;
}
-#ifdef DAMAGEEXT
- FlushIfCriticalOutputPending ();
-#endif
}
FlushAllOutput();
#ifdef SMART_SCHEDULE
@@ -493,7 +491,9 @@ Dispatch(void)
if (client)
client->smart_stop_tick = SmartScheduleTime;
#endif
+#ifdef XPRINT
requestingClient = NULL;
+#endif
}
dispatchException &= ~DE_PRIORITYCHANGE;
}
@@ -995,8 +995,8 @@ ProcSetSelectionOwner(ClientPtr client)
{
int i = 0;
- rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->selection,
- DixSetAttrAccess);
+ rc = XaceHookSelectionAccess(client, stuff->selection,
+ DixSetAttrAccess);
if (rc != Success)
return rc;
@@ -1082,8 +1082,7 @@ ProcGetSelectionOwner(ClientPtr client)
int rc, i;
xGetSelectionOwnerReply reply;
- rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->id,
- DixGetAttrAccess);
+ rc = XaceHookSelectionAccess(client, stuff->id, DixGetAttrAccess);
if (rc != Success)
return rc;
@@ -1128,8 +1127,7 @@ ProcConvertSelection(ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->requestor, client, DixSetAttrAccess);
if (rc != Success)
return rc;
- rc = XaceHook(XACE_SELECTION_ACCESS, client, stuff->selection,
- DixReadAccess);
+ rc = XaceHookSelectionAccess(client, stuff->selection, DixReadAccess);
if (rc != Success)
return rc;
@@ -2538,7 +2536,7 @@ ProcFreeColormap(ClientPtr client)
else
{
client->errorValue = stuff->id;
- return rc;
+ return (rc == BadValue) ? BadColor : rc;
}
}
@@ -2567,7 +2565,7 @@ ProcCopyColormapAndFree(ClientPtr client)
else
{
client->errorValue = stuff->srcCmap;
- return rc;
+ return (rc == BadValue) ? BadColor : rc;
}
}
@@ -2659,7 +2657,7 @@ ProcListInstalledColormaps(ClientPtr client)
xfree(preply);
rc = client->noClientException;
out:
- return (rc == BadValue) ? BadColor : rc;
+ return rc;
}
int
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 4cc8d7188..0e6fa0300 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1644,9 +1644,6 @@ FreeFontPath(FontPathElementPtr *list, int n, Bool force)
found++;
}
if (list[i]->refcount != found) {
- ErrorF("[dix] FreeFontPath: FPE \"%.*s\" refcount is %d, should be %d; fixing.\n",
- list[i]->name_length, list[i]->name,
- list[i]->refcount, found);
list[i]->refcount = found; /* ensure it will get freed */
}
}
@@ -1934,12 +1931,15 @@ GetDefaultPointSize ()
FontResolutionPtr
GetClientResolutions (int *num)
{
+#ifdef XPRINT
if (requestingClient && requestingClient->fontResFunc != NULL &&
!requestingClient->clientGone)
{
return (*requestingClient->fontResFunc)(requestingClient, num);
}
- else {
+ else
+#endif
+ {
static struct _FontResolution res;
ScreenPtr pScreen;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index dd485d518..aaf510623 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -816,16 +816,8 @@ _DeleteCallbackList(
*pcbl = NULL;
}
-static CallbackFuncsRec default_cbfuncs =
-{
- _AddCallback,
- _DeleteCallback,
- _CallCallbacks,
- _DeleteCallbackList
-};
-
static Bool
-CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
+CreateCallbackList(CallbackListPtr *pcbl)
{
CallbackListPtr cbl;
int i;
@@ -833,7 +825,6 @@ CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs)
if (!pcbl) return FALSE;
cbl = (CallbackListPtr) xalloc(sizeof(CallbackListRec));
if (!cbl) return FALSE;
- cbl->funcs = cbfuncs ? *cbfuncs : default_cbfuncs;
cbl->inCallback = 0;
cbl->deleted = FALSE;
cbl->numDeleted = 0;
@@ -864,31 +855,31 @@ AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
if (!pcbl) return FALSE;
if (!*pcbl)
{ /* list hasn't been created yet; go create it */
- if (!CreateCallbackList(pcbl, (CallbackFuncsPtr)NULL))
+ if (!CreateCallbackList(pcbl))
return FALSE;
}
- return ((*(*pcbl)->funcs.AddCallback) (pcbl, callback, data));
+ return _AddCallback(pcbl, callback, data);
}
_X_EXPORT Bool
DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
{
if (!pcbl || !*pcbl) return FALSE;
- return ((*(*pcbl)->funcs.DeleteCallback) (pcbl, callback, data));
+ return _DeleteCallback(pcbl, callback, data);
}
void
CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
{
if (!pcbl || !*pcbl) return;
- (*(*pcbl)->funcs.CallCallbacks) (pcbl, call_data);
+ _CallCallbacks(pcbl, call_data);
}
void
DeleteCallbackList(CallbackListPtr *pcbl)
{
if (!pcbl || !*pcbl) return;
- (*(*pcbl)->funcs.DeleteCallbackList) (pcbl);
+ _DeleteCallbackList(pcbl);
}
void
diff --git a/dix/getevents.c b/dix/getevents.c
index 753790653..b2be9bd3d 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -358,10 +358,13 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axes = pDev->valuator->axes + axisNum;
- if (*val < axes->min_value)
- *val = axes->min_value;
- if (axes->max_value >= 0 && *val > axes->max_value)
- *val = axes->max_value;
+ /* No clipping if the value-range <= 0 */
+ if(axes->min_value < axes->min_value) {
+ if (*val < axes->min_value)
+ *val = axes->min_value;
+ if (*val > axes->max_value)
+ *val = axes->max_value;
+ }
}
/**
@@ -660,10 +663,6 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
CARD32 ms = 0;
deviceKeyButtonPointer *kbp = NULL;
DeviceIntPtr master;
-
- /* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies
- * with DeviceValuators. */
- Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE);
int x = 0, y = 0;
/* The core pointer must not send Xi events. */
Bool coreOnly = (pDev == inputInfo.pointer);
@@ -701,7 +700,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
}
/* Do we need to send a DeviceValuator event? */
- if (!coreOnly && sendValuators) {
+ if (!coreOnly && num_valuators) {
if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS)
num_valuators = MAX_VALUATOR_EVENTS * 6;
num_events += ((num_valuators - 1) / 6) + 1;
@@ -793,7 +792,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
kbp->root_y = y;
events++;
- if (sendValuators) {
+ if (num_valuators) {
kbp->deviceid |= MORE_EVENTS;
clipValuators(pDev, first_valuator, num_valuators, valuators);
events = getValuatorEvents(events, pDev, first_valuator,
diff --git a/dix/globals.c b/dix/globals.c
index d76b604da..7f95eabd5 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -143,7 +143,9 @@ Bool loadableFonts = FALSE;
CursorPtr rootCursor;
Bool blackRoot=FALSE;
Bool whiteRoot=FALSE;
+#ifdef XPRINT
ClientPtr requestingClient; /* XXX this should be obsolete now, remove? */
+#endif
_X_EXPORT TimeStamp currentTime;
_X_EXPORT TimeStamp lastDeviceEventTime;
diff --git a/dix/main.c b/dix/main.c
index 63e3273c6..d229c192e 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -137,8 +137,6 @@ _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[33];
int connBlockScreenStart;
-static int restart = 0;
-
_X_EXPORT void
NotImplemented(xEvent *from, xEvent *to)
{
@@ -264,13 +262,6 @@ main(int argc, char *argv[], char *envp[])
DarwinHandleGUI(argc, argv, envp);
#endif
- /* Notice if we're restarted. Probably this is because we jumped through
- * an uninitialized pointer */
- if (restart)
- FatalError("server restarted. Jumped through uninitialized pointer?\n");
- else
- restart = 1;
-
CheckUserParameters(argc, argv, envp);
CheckUserAuthorization();
diff --git a/dix/property.c b/dix/property.c
index 45b32bc7f..8cc4fefb7 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -156,8 +156,8 @@ ProcRotateProperties(ClientPtr client)
xfree(props);
return BadMatch;
}
- rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp,
- DixReadAccess|DixWriteAccess);
+ rc = XaceHookPropertyAccess(client, pWin, pProp,
+ DixReadAccess|DixWriteAccess);
if (rc != Success) {
xfree(props);
client->errorValue = atoms[i];
@@ -276,8 +276,8 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
memmove((char *)data, (char *)value, totalSize);
pProp->size = len;
pProp->devPrivates = NULL;
- rc = XaceHook(XACE_PROPERTY_ACCESS, pClient, pWin, pProp,
- DixCreateAccess|DixWriteAccess);
+ rc = XaceHookPropertyAccess(pClient, pWin, pProp,
+ DixCreateAccess|DixWriteAccess);
if (rc != Success) {
xfree(data);
xfree(pProp);
@@ -289,8 +289,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
}
else
{
- rc = XaceHook(XACE_PROPERTY_ACCESS, pClient, pWin, pProp,
- DixWriteAccess);
+ rc = XaceHookPropertyAccess(pClient, pWin, pProp, DixWriteAccess);
if (rc != Success) {
pClient->errorValue = property;
return rc;
@@ -382,8 +381,7 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
}
if (pProp)
{
- rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp,
- DixDestroyAccess);
+ rc = XaceHookPropertyAccess(client, pWin, pProp, DixDestroyAccess);
if (rc != Success)
return rc;
@@ -502,7 +500,7 @@ ProcGetProperty(ClientPtr client)
if (stuff->delete)
access_mode |= DixDestroyAccess;
- rc = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, pProp, access_mode);
+ rc = XaceHookPropertyAccess(client, pWin, pProp, access_mode);
if (rc != Success) {
client->errorValue = stuff->property;
return rc;
diff --git a/dix/resource.c b/dix/resource.c
index dfc7bead0..81b2e95a7 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -535,7 +535,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
ResourcePtr *prev, *head;
int *eltptr;
int elements;
- Bool gotOne = FALSE;
if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets)
{
@@ -563,15 +562,11 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
xfree(res);
if (*eltptr != elements)
prev = head; /* prev may no longer be valid */
- gotOne = TRUE;
}
else
prev = &res->next;
}
}
- if (!gotOne)
- ErrorF("[dix] Freeing resource id=%lX which isn't there.\n",
- (unsigned long)id);
}
diff --git a/dix/window.c b/dix/window.c
index a941dacd7..ee4c75649 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -305,9 +305,8 @@ SetWindowToDefaults(WindowPtr pWin)
pWin->deliverableEvents = 0;
pWin->dontPropagate = 0;
pWin->forcedBS = FALSE;
-#ifdef COMPOSITE
pWin->redirectDraw = RedirectDrawNone;
-#endif
+ pWin->forcedBG = FALSE;
sem = xcalloc(1, sizeof(FocusSemaphoresRec));
dixSetPrivate(&pWin->devPrivates, FocusPrivatesKey, sem);
@@ -734,8 +733,8 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
return NullWindow;
}
- pWin->backgroundState = XaceBackgroundNoneState;
- pWin->background.pixel = 0;
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
pWin->borderIsPixel = pParent->borderIsPixel;
pWin->border = pParent->border;
@@ -1066,8 +1065,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
if (!pWin->parent)
MakeRootTile(pWin);
else {
- pWin->backgroundState = XaceBackgroundNoneState;
- pWin->background.pixel = 0;
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
}
}
else if (pixID == ParentRelative)
@@ -2205,7 +2204,7 @@ WhereDoIGoInTheStack(
return pWin->nextSib;
default:
{
- ErrorF("[dix] Internal error in ConfigureWindow, smode == %d\n",smode );
+ /* should never happen; make something up. */
return pWin->nextSib;
}
}