summaryrefslogtreecommitdiffstats
path: root/generic/tkError.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkError.c')
-rw-r--r--generic/tkError.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/generic/tkError.c b/generic/tkError.c
index fc223e6..277d7f0 100644
--- a/generic/tkError.c
+++ b/generic/tkError.c
@@ -82,8 +82,8 @@ Tk_CreateErrorHandler(
* errors. */
ClientData clientData) /* Arbitrary value to pass to errorProc. */
{
- register TkErrorHandler *errorPtr;
- register TkDisplay *dispPtr;
+ TkErrorHandler *errorPtr;
+ TkDisplay *dispPtr;
/*
* Find the display. If Tk doesn't know about this display then it's an
@@ -147,8 +147,8 @@ Tk_DeleteErrorHandler(
Tk_ErrorHandler handler) /* Token for handler to delete; was previous
* return value from Tk_CreateErrorHandler. */
{
- register TkErrorHandler *errorPtr = (TkErrorHandler *) handler;
- register TkDisplay *dispPtr = errorPtr->dispPtr;
+ TkErrorHandler *errorPtr = (TkErrorHandler *) handler;
+ TkDisplay *dispPtr = errorPtr->dispPtr;
errorPtr->lastRequest = NextRequest(dispPtr->display) - 1;
@@ -166,12 +166,20 @@ Tk_DeleteErrorHandler(
dispPtr->deleteCount += 1;
if (dispPtr->deleteCount >= 10) {
- register TkErrorHandler *prevPtr;
+ TkErrorHandler *prevPtr;
TkErrorHandler *nextPtr;
- int lastSerial;
+ int lastSerial = LastKnownRequestProcessed(dispPtr->display);
+ /*
+ * Last chance to catch errors for this handler: if no event/error
+ * processing took place to follow up the end of this error handler
+ * we need a round trip with the X server now.
+ */
+
+ if (errorPtr->lastRequest > (unsigned long) lastSerial) {
+ XSync(dispPtr->display, False);
+ }
dispPtr->deleteCount = 0;
- lastSerial = LastKnownRequestProcessed(dispPtr->display);
errorPtr = dispPtr->errorPtr;
for (prevPtr = NULL; errorPtr != NULL; errorPtr = nextPtr) {
nextPtr = errorPtr->nextPtr;
@@ -213,11 +221,11 @@ Tk_DeleteErrorHandler(
static int
ErrorProc(
Display *display, /* Display for which error occurred. */
- register XErrorEvent *errEventPtr)
+ XErrorEvent *errEventPtr)
/* Information about error. */
{
- register TkDisplay *dispPtr;
- register TkErrorHandler *errorPtr;
+ TkDisplay *dispPtr;
+ TkErrorHandler *errorPtr;
/*
* See if we know anything about the display. If not, then invoke the