Hello, On Fri, 23 Dec 2016 17:29:28 +0100 Paolo Bonzini <pbonz...@redhat.com> wrote:
> On 23/12/2016 16:12, Michal Suchanek wrote: > > This copies the timer hack from ui/console.c kbd_send_chars to > > ui/gtk.c gd_vc_in. > > > > There is no fd-like object to peek repatedly so the paste data is > > saved in a free-floating buffer only submitted to gtk_timeout_add. > > Multiple pastes can potentially interleave if qemu blocks for long > > or the user pastes fast. > > Do not use a timer, instead set chr->chr_accept_input in > gd_vc_handler. The callback can do basically what you are doing in > gd_vc_in_timer. The buffer can be just a GString plus a "head" > pointer, in VirtualConsole. Once the head catches up with the tail, > you can free the GString. How do you propose to use that callback? I did not find a documentation for it. It takes no argument (except the chr object self) so there is no way to pass in the buffer. It cannot be replaced - it is set in non-ui code in multiple places and never in ui code. Thanks Michal