Commit e3f6e7c7 authored by Kim F. Storm's avatar Kim F. Storm
Browse files

(kbd_buffer_store_event_hold): Remove obsolete code.

(kbd_buffer_unget_event): New function.
(kbd_buffer_get_event, swallow_events): Combine SELECTION events
and use x_handle_selection_event.
(mark_kboards): Don't mark x and y of SELECTION_CLEAR_EVENT.
parent 36a2b04c
......@@ -3698,36 +3698,26 @@ kbd_buffer_store_event_hold (event, hold_quit)
Discard the event if it would fill the last slot. */
if (kbd_fetch_ptr - 1 != kbd_store_ptr)
{
*kbd_store_ptr = *event;
++kbd_store_ptr;
}
}
#if 0 /* The SELECTION_REQUEST_EVENT case looks bogus, and it's error
prone to assign individual members for other events, in case
the input_event structure is changed. --2000-07-13, gerd. */
struct input_event *sp = kbd_store_ptr;
sp->kind = event->kind;
if (event->kind == SELECTION_REQUEST_EVENT)
{
/* We must not use the ordinary copying code for this case,
since `part' is an enum and copying it might not copy enough
in this case. */
bcopy (event, (char *) sp, sizeof (*event));
}
else
{
sp->code = event->code;
sp->part = event->part;
sp->frame_or_window = event->frame_or_window;
sp->arg = event->arg;
sp->modifiers = event->modifiers;
sp->x = event->x;
sp->y = event->y;
sp->timestamp = event->timestamp;
}
#else
*kbd_store_ptr = *event;
#endif
/* Put an input event back in the head of the event queue. */
++kbd_store_ptr;
void
kbd_buffer_unget_event (event)
register struct input_event *event;
{
if (kbd_fetch_ptr == kbd_buffer)
kbd_fetch_ptr = kbd_buffer + KBD_BUFFER_SIZE;
/* Don't let the very last slot in the buffer become full, */
if (kbd_fetch_ptr - 1 != kbd_store_ptr)
{
--kbd_fetch_ptr;
*kbd_fetch_ptr = *event;
}
}
......@@ -3942,7 +3932,8 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
/* These two kinds of events get special handling
and don't actually appear to the command loop.
We return nil for them. */
if (event->kind == SELECTION_REQUEST_EVENT)
if (event->kind == SELECTION_REQUEST_EVENT
|| event->kind == SELECTION_CLEAR_EVENT)
{
#ifdef HAVE_X11
struct input_event copy;
......@@ -3953,7 +3944,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
copy = *event;
kbd_fetch_ptr = event + 1;
input_pending = readable_events (0);
x_handle_selection_request (&copy);
x_handle_selection_event (&copy);
#else
/* We're getting selection request events, but we don't have
a window system. */
......@@ -3961,22 +3952,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
#endif
}
else if (event->kind == SELECTION_CLEAR_EVENT)
{
#ifdef HAVE_X11
struct input_event copy;
/* Remove it from the buffer before processing it. */
copy = *event;
kbd_fetch_ptr = event + 1;
input_pending = readable_events (0);
x_handle_selection_clear (&copy);
#else
/* We're getting selection request events, but we don't have
a window system. */
abort ();
#endif
}
#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (MAC_OS)
else if (event->kind == DELETE_WINDOW_EVENT)
{
......@@ -4201,7 +4176,8 @@ swallow_events (do_display)
/* These two kinds of events get special handling
and don't actually appear to the command loop. */
if (event->kind == SELECTION_REQUEST_EVENT)
if (event->kind == SELECTION_REQUEST_EVENT
|| event->kind == SELECTION_CLEAR_EVENT)
{
#ifdef HAVE_X11
struct input_event copy;
......@@ -4212,25 +4188,7 @@ swallow_events (do_display)
copy = *event;
kbd_fetch_ptr = event + 1;
input_pending = readable_events (0);
x_handle_selection_request (&copy);
#else
/* We're getting selection request events, but we don't have
a window system. */
abort ();
#endif
}
else if (event->kind == SELECTION_CLEAR_EVENT)
{
#ifdef HAVE_X11
struct input_event copy;
/* Remove it from the buffer before processing it, */
copy = *event;
kbd_fetch_ptr = event + 1;
input_pending = readable_events (0);
x_handle_selection_clear (&copy);
x_handle_selection_event (&copy);
#else
/* We're getting selection request events, but we don't have
a window system. */
......@@ -11456,7 +11414,8 @@ mark_kboards ()
{
if (event == kbd_buffer + KBD_BUFFER_SIZE)
event = kbd_buffer;
if (event->kind != SELECTION_REQUEST_EVENT)
if (event->kind != SELECTION_REQUEST_EVENT
&& event->kind != SELECTION_CLEAR_EVENT)
{
mark_object (event->x);
mark_object (event->y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment