summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-02-10 17:32:31 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-02-10 17:32:31 (GMT)
commit646a119ed2117b0f3fb7feb59a03deff829a7b52 (patch)
tree75cd0e2d7dc9ed335a01eace9322b5b35d1b11fb /generic
parent9acf511761132494298b4b03ef9746dd1411ba30 (diff)
parent1529121eab4223cfa1215020372ba0bddadfa8c8 (diff)
downloadtk-646a119ed2117b0f3fb7feb59a03deff829a7b52.zip
tk-646a119ed2117b0f3fb7feb59a03deff829a7b52.tar.gz
tk-646a119ed2117b0f3fb7feb59a03deff829a7b52.tar.bz2
Fix [1821174fff] and [1938774fff]: RenderBadPicture (invalid Picture parameter) error returned on application exit when 'send' was renamed to {}. Patch from Christian Werner. Thanks to Joe English.
Diffstat (limited to 'generic')
-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