]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
GTK3: give I/O events lower priority than window redraws.
authorSimon Tatham <anakin@pobox.com>
Sun, 20 Mar 2016 19:44:23 +0000 (19:44 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 20 Mar 2016 19:44:23 +0000 (19:44 +0000)
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.

unix/gtkwin.c

index e711458e80dc69f4f8ca727efe11e73d21164826..2879b57e9877814b27202f4f8716aa613c64d320 100644 (file)
@@ -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;