diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-10-31 14:09:45 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-10-31 14:09:45 +0000 |
commit | 80408f471074022f7300901bf92a1533dae3f8da (patch) | |
tree | 37ed25a9624c9e24630dcb235c843abc131cef7e /xserver/dix | |
parent | 8d7a9cbb99636c52f7ead5912f5f2bf2d9f39ebf (diff) |
Update to server 1.6.5.
Diffstat (limited to 'xserver/dix')
-rw-r--r-- | xserver/dix/dixfonts.c | 29 | ||||
-rw-r--r-- | xserver/dix/getevents.c | 4 |
2 files changed, 28 insertions, 5 deletions
diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c index 719bca469..174372e93 100644 --- a/xserver/dix/dixfonts.c +++ b/xserver/dix/dixfonts.c @@ -1815,6 +1815,9 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) int SetDefaultFontPath(char *path) { + char *temp_path, + *start, + *end; unsigned char *cp, *pp, *nump, @@ -1825,12 +1828,31 @@ SetDefaultFontPath(char *path) size = 0, bad; + /* ensure temp_path contains "built-ins" */ + start = path; + while (1) { + start = strstr(start, "built-ins"); + if (start == NULL) + break; + end = start + strlen("built-ins"); + if ((start == path || start[-1] == ',') && (!*end || *end == ',')) + break; + start = end; + } + if (!start) { + temp_path = Xprintf("%s%sbuilt-ins", path, *path ? "," : ""); + } else { + temp_path = Xstrdup(path); + } + if (!temp_path) + return BadAlloc; + /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; - nump = cp = newpath = (unsigned char *) xalloc(len); + len = strlen(temp_path) + 1; + nump = cp = newpath = xalloc(len); if (!newpath) return BadAlloc; - pp = (unsigned char *) path; + pp = (unsigned char *) temp_path; cp++; while (*pp) { if (*pp == ',') { @@ -1849,6 +1871,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); xfree(newpath); + xfree(temp_path); return err; } diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c index 9747b35a6..eadcbeb48 100644 --- a/xserver/dix/getevents.c +++ b/xserver/dix/getevents.c @@ -536,7 +536,7 @@ static EventListPtr updateFromMaster(EventListPtr events, DeviceIntPtr dev, int *num_events) { DeviceIntPtr master = dev->u.master; - if (master && master->u.lastSlave != dev) + if (master && master->u.lastSlave != dev && dev->coreEvents) { updateSlaveDeviceCoords(master, dev); master->u.lastSlave = dev; @@ -674,7 +674,7 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, * to the current screen. */ miPointerSetPosition(dev, &dev->last.valuators[0], &dev->last.valuators[1]); - if (dev->u.master) { + if (dev->u.master && dev->coreEvents) { dev->u.master->last.valuators[0] = dev->last.valuators[0]; dev->u.master->last.valuators[1] = dev->last.valuators[1]; } |