1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

GTK: run toplevel callbacks when an fd is active.

Normally, the GTK code runs toplevel callbacks from a GTK 'idle
function'. But those mean what they say: they are considered
low-priority, to be run _only_ when the system is idle - so they can
fail to run at all in conditions of a steady stream of higher-priority
things, e.g. something is throwing data at the application so fast
that every main-loop iteration finds a readable fd.

And that's not good, because _we_ don't think our callbacks are
low-priority: they do a lot of really important work like redrawing
the window. So if they never get round to happening, PuTTY or pterm
can appear to lock up.

Simple solution to that one: whenever we process a select notification
on any fd, we _also_ call run_toplevel_callbacks(). Then our callbacks
are bound to happen reasonably regularly.
This commit is contained in:
Simon Tatham 2021-12-19 13:13:37 +00:00
parent bc91a39670
commit 4721571b8b

View File

@ -86,6 +86,8 @@ gboolean fd_input_func(GIOChannel *source, GIOCondition condition,
if (condition & G_IO_OUT)
select_result(sourcefd, SELECT_W);
run_toplevel_callbacks();
return true;
}
#else
@ -97,6 +99,8 @@ void fd_input_func(gpointer data, gint sourcefd, GdkInputCondition condition)
select_result(sourcefd, SELECT_R);
if (condition & GDK_INPUT_WRITE)
select_result(sourcefd, SELECT_W);
run_toplevel_callbacks();
}
#endif