From 661d89a09b6beb9694250f7d91b0b4b47ecc6c61 Mon Sep 17 00:00:00 2001 From: dickmao Date: Wed, 7 Dec 2022 00:03:17 -0500 Subject: [PATCH] Squashed commit of the following: commit 18220432ba76608d579b00a96e03567b715461da Author: dickmao Date: Tue Dec 6 23:55:17 2022 -0500 fallout c73f99f --- src/xselect.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/xselect.c b/src/xselect.c index 121b17df1b0..78820cb3a7c 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -624,6 +624,13 @@ x_pop_current_selection_request (void) xfree (tem); } +static bool +x_selection_for_multiple (struct selection_data *data) +{ + return (Atom *) data->data + == &selection_request_stack->conversion_fail_tag; +} + /* Used as an unwind-protect clause so that, if a selection-converter signals an error, we tell the requestor that we were unable to do what they wanted before we throw to top-level or go into the debugger or whatever. */ @@ -639,7 +646,7 @@ x_selection_request_lisp_error (void) for (cs = frame->converted_selections; cs; cs = next) { next = cs->next; - if (cs->data) + if (cs->data && ! x_selection_for_multiple (cs)) xfree (cs->data); xfree (cs); } @@ -839,8 +846,7 @@ x_start_selection_transfer (struct x_display_info *dpyinfo, Window requestor, secs = timeout / 1000; nsecs = (timeout % 1000) * 1000000; - if ((Atom *) data->data - == &selection_request_stack->conversion_fail_tag) + if (x_selection_for_multiple (data)) return; transfer = xzalloc (sizeof *transfer); -- 2.36.1