From 4581e9282b7fc20505c6267157b321e5f2a5cc94 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Feb 1995 18:55:39 +0000 Subject: [PATCH] (kbd_buffer_get_event, swallow_events): Remove selection_request event from input queue before processing it. --- src/keyboard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index ea0f10bd110..fca3d3a1599 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2142,8 +2142,12 @@ kbd_buffer_get_event () if (event->kind == selection_request_event) { #ifdef HAVE_X11 - x_handle_selection_request (event); + struct input_event copy = *event; + /* Remove it from the buffer before processing it, + since otherwise swallow_events will see it + and process it again. */ perd->kbd_fetch_ptr = event + 1; + x_handle_selection_request (©); #else /* We're getting selection request events, but we don't have a window system. */ @@ -2319,8 +2323,10 @@ swallow_events () if (event->kind == selection_request_event) { #ifdef HAVE_X11 - x_handle_selection_request (event); + struct input_event copy; + copy = *event; perd->kbd_fetch_ptr = event + 1; + x_handle_selection_request (©); #else /* We're getting selection request events, but we don't have a window system. */ -- 2.39.5