]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor correction to X error handling
authorPo Lu <luangruo@yahoo.com>
Wed, 12 Jul 2023 10:07:53 +0000 (18:07 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 12 Jul 2023 10:07:53 +0000 (18:07 +0800)
* 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

index d65a6829b456fe6b3cf10d75af61c546fa7bacd6..9ecead03b0836fd0fa7dfc109e2dbea107013390 100644 (file)
@@ -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;
        }