emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d861de72289 2/2: Minor correction to X error handling


From: Po Lu
Subject: master d861de72289 2/2: Minor correction to X error handling
Date: Wed, 12 Jul 2023 06:08:44 -0400 (EDT)

branch: master
commit d861de72289464e336c772f1741016a90a2118c5
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Minor correction to X error handling
    
    * src/xterm.c (x_error_handler): Clear fail->selection_serial
    after reporting an error during selection transfer, in case any
    other outstanding requests within the protected section also
    report errors.
---
 src/xterm.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index d65a6829b45..9ecead03b08 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -26439,9 +26439,18 @@ x_error_handler (Display *display, XErrorEvent *event)
 
          /* If a selection transfer is the cause of this error,
             remove the selection transfer now.  */
+
          if (fail->selection_serial)
-           x_handle_selection_error (fail->selection_serial,
-                                     event);
+           {
+             x_handle_selection_error (fail->selection_serial,
+                                       event);
+
+             /* Clear selection_serial to prevent
+                x_handle_selection_error from being called again if
+                any more requests within the protected section cause
+                errors to be reported.  */
+             fail->selection_serial = 0;
+           }
 
          return 0;
        }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]