From 6d895f30ab93d71afddc612d8b007f2de7f04165 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 21 Oct 2013 07:47:02 +0200 Subject: fontconfig mesa xserver xkeyboard-config git update 21 okt 2013 xserver commit 8db4121a3c7104548fd4a138ac1d1bdea5fd22d9 libxcb commit e4e0c6eec861f4c69da12060dc8dbe7a63fa5eb6 libxcb/xcb-proto commit 55c75accecf0e76d2aa38656efd2be4044b9e643 xkeyboard-config commit 39a9a10ff11f6872e4b278240fbabb4e98209fa6 libX11 commit 18a5278b008e9faa59b346fcab18a8d74b875fda libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854 libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4 libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff libXau commit 304a11be4727c5a7feeb2501e8e001466f8ce84e xkbcomp commit 839ccda42d8b088d94324cd77c4be954859914d3 pixman commit 3c2f4b651747c1ac484c39d5128cae5483094342 xextproto commit f27fcc99d1cf935cc289933326f7d3baacd5107a randrproto commit ca7cc541c2e43e6c784df19b4583ac35829d2f72 glproto commit 8e3407e02980d088e20041e79bdcdd3737e7827e mkfontscale commit f48de13423c7300f4da9f61993b624426b38ddc0 xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13 libXft commit c5e760a239afc62a1c75e0509868e35957c8df52 libXmu commit 2539e539eafdac88177c8ee30b043c5d52f017e4 libxtrans commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0 fontconfig commit 5e029db4971e37437cfe6147d52d00136dfb8cb5 mesa commit 14429295e16cf9b7616494fb68f400dfb9c80c71 --- xorg-server/dix/dixfonts.c | 5 ++++ xorg-server/dix/events.c | 73 ++++++++++++++++++++++++++++++++++++++-------- xorg-server/dix/globals.c | 1 - xorg-server/dix/window.c | 4 +-- 4 files changed, 67 insertions(+), 16 deletions(-) (limited to 'xorg-server/dix') diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index feb765d1c..2e34d370f 100644 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -1425,6 +1425,7 @@ doImageText(ClientPtr client, ITclosurePtr c) GC *pGC; unsigned char *data; ITclosurePtr new_closure; + ITclosurePtr old_closure; /* We're putting the client to sleep. We need to save some state. Similar problem to that handled @@ -1436,12 +1437,14 @@ doImageText(ClientPtr client, ITclosurePtr c) err = BadAlloc; goto bail; } + old_closure = c; *new_closure = *c; c = new_closure; data = malloc(c->nChars * itemSize); if (!data) { free(c); + c = old_closure; err = BadAlloc; goto bail; } @@ -1452,6 +1455,7 @@ doImageText(ClientPtr client, ITclosurePtr c) if (!pGC) { free(c->data); free(c); + c = old_closure; err = BadAlloc; goto bail; } @@ -1464,6 +1468,7 @@ doImageText(ClientPtr client, ITclosurePtr c) FreeScratchGC(pGC); free(c->data); free(c); + c = old_closure; err = BadAlloc; goto bail; } diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index 7a1b1c3c6..4632bb7db 100644 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -262,6 +262,11 @@ InputInfo inputInfo; EventSyncInfoRec syncEvents; +static struct DeviceEventTime { + Bool reset; + TimeStamp time; +} lastDeviceEventTime[MAXDEVICES]; + /** * The root window the given device is currently on. */ @@ -1043,33 +1048,73 @@ XineramaGetCursorScreen(DeviceIntPtr pDev) #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ static void -MonthChangedOrBadTime(InternalEvent *ev) +MonthChangedOrBadTime(CARD32 *ms) { /* If the ddx/OS is careless about not processing timestamped events from * different sources in sorted order, then it's possible for time to go * backwards when it should not. Here we ensure a decent time. */ - if ((currentTime.milliseconds - ev->any.time) > TIMESLOP) + if ((currentTime.milliseconds - *ms) > TIMESLOP) currentTime.months++; else - ev->any.time = currentTime.milliseconds; + *ms = currentTime.milliseconds; +} + +void +NoticeTime(const DeviceIntPtr dev, TimeStamp time) +{ + lastDeviceEventTime[XIAllDevices].time = currentTime; + lastDeviceEventTime[dev->id].time = currentTime; + + LastEventTimeToggleResetFlag(dev->id, TRUE); + LastEventTimeToggleResetFlag(XIAllDevices, TRUE); } static void -NoticeTime(InternalEvent *ev, DeviceIntPtr dev) +NoticeTimeMillis(const DeviceIntPtr dev, CARD32 *ms) { - if (ev->any.time < currentTime.milliseconds) - MonthChangedOrBadTime(ev); - currentTime.milliseconds = ev->any.time; - lastDeviceEventTime[XIAllDevices] = currentTime; - lastDeviceEventTime[dev->id] = currentTime; + TimeStamp time; + if (*ms < currentTime.milliseconds) + MonthChangedOrBadTime(ms); + time.months = currentTime.months; + time.milliseconds = *ms; + NoticeTime(dev, time); } void NoticeEventTime(InternalEvent *ev, DeviceIntPtr dev) { if (!syncEvents.playingEvents) - NoticeTime(ev, dev); + NoticeTimeMillis(dev, &ev->any.time); +} + +TimeStamp +LastEventTime(int deviceid) +{ + return lastDeviceEventTime[deviceid].time; +} + +Bool +LastEventTimeWasReset(int deviceid) +{ + return lastDeviceEventTime[deviceid].reset; +} + +void +LastEventTimeToggleResetFlag(int deviceid, Bool state) +{ + lastDeviceEventTime[deviceid].reset = state; +} + +void +LastEventTimeToggleResetAll(Bool state) +{ + DeviceIntPtr dev; + nt_list_for_each_entry(dev, inputInfo.devices, next) { + LastEventTimeToggleResetFlag(dev->id, FALSE); + } + LastEventTimeToggleResetFlag(XIAllDevices, FALSE); + LastEventTimeToggleResetFlag(XIAllMasterDevices, FALSE); } /************************************************************************** @@ -1093,7 +1138,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) if (!xorg_list_is_empty(&syncEvents.pending)) tail = xorg_list_last_entry(&syncEvents.pending, QdEventRec, next); - NoticeTime((InternalEvent *)event, device); + NoticeTimeMillis(device, &ev->any.time); /* Fix for key repeating bug. */ if (device->key != NULL && device->key->xkbInfo != NULL && @@ -5276,8 +5321,12 @@ InitEvents(void) inputInfo.pointer = (DeviceIntPtr) NULL; for (i = 0; i < MAXDEVICES; i++) { + DeviceIntRec dummy; memcpy(&event_filters[i], default_filter, sizeof(default_filter)); - lastDeviceEventTime[i] = currentTime; + + dummy.id = i; + NoticeTime(&dummy, currentTime); + LastEventTimeToggleResetFlag(i, FALSE); } syncEvents.replayDev = (DeviceIntPtr) NULL; diff --git a/xorg-server/dix/globals.c b/xorg-server/dix/globals.c index 332b91f5c..ad9145b01 100644 --- a/xorg-server/dix/globals.c +++ b/xorg-server/dix/globals.c @@ -122,7 +122,6 @@ Bool party_like_its_1989 = FALSE; Bool whiteRoot = FALSE; TimeStamp currentTime; -TimeStamp lastDeviceEventTime[MAXDEVICES]; int defaultColorVisualClass = -1; int monitorResolution = 0; diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index cff341b65..92df1eb4c 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -3089,9 +3089,7 @@ dixSaveScreens(ClientPtr client, int on, int mode) DeviceIntPtr dev; UpdateCurrentTimeIf(); nt_list_for_each_entry(dev, inputInfo.devices, next) - lastDeviceEventTime[dev->id] = currentTime; - lastDeviceEventTime[XIAllDevices] = currentTime; - lastDeviceEventTime[XIAllMasterDevices] = currentTime; + NoticeTime(dev, currentTime); } SetScreenSaverTimer(); } -- cgit v1.2.3