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.
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;