From: Simon Tatham Date: Sun, 20 Mar 2016 19:44:23 +0000 (+0000) Subject: GTK3: give I/O events lower priority than window redraws. X-Git-Tag: 0.68~261 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ece38fbb211a0d0ab28e8e1356c033e3133c7db2;p=PuTTY.git GTK3: give I/O events lower priority than window redraws. If you run something like 'seq 2000000000' in a GTK3 pterm, the window never actually updates, because pterm always considers reading more data from the pty to have higher priority than delivering the "draw" event. Using g_io_add_watch_full instead of g_io_add_watch allows us to explicitly lower the priority of the I/O sources, so that window redraws will take precedence. --- diff --git a/unix/gtkwin.c b/unix/gtkwin.c index e711458e..2879b57e 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -4053,7 +4053,8 @@ uxsel_id *uxsel_input_add(int fd, int rwx) { if (rwx & 4) flags |= G_IO_PRI; id->chan = g_io_channel_unix_new(fd); g_io_channel_set_encoding(id->chan, NULL, NULL); - id->watch_id = g_io_add_watch(id->chan, flags, fd_input_func, NULL); + id->watch_id = g_io_add_watch_full(id->chan, GDK_PRIORITY_REDRAW+1, flags, + fd_input_func, NULL, NULL); #else int flags = 0; if (rwx & 1) flags |= GDK_INPUT_READ;