(event_to_perdisplay): New function.
(kbd_buffer_get_event): Use event_to_perdisplay. (kbd_buffer_store_event): If C-g arrives while we're in the run state on behalf of another display, just clear the queue and deposit the C-g to be read later. (read_key_sequence): After a throw, unwind delayed_switch_frame as well as keybuf. Don't insert an extra switch-frame if empty.
Showing with 74 additions and 23 deletions