diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-04-03 13:49:58 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-04-03 13:49:58 -0700 |
commit | 1543d02f96bdf96a067e96742577ea740dda4d89 (patch) | |
tree | 455d72f7cc027ab3dde815662222675331b2261f /reader.cpp | |
parent | 11a444e914820bd8dc9a0f2e87e2585137af713b (diff) |
Add callbacks that get invoked before the next call to select(), which will allow for a nice fix to https://github.com/fish-shell/fish-shell/issues/608. Eliminate the poll handler, and replace it with this mechanism.
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -815,9 +815,6 @@ void reader_init() #ifdef VDSUSP shell_modes.c_cc[VDSUSP] = _POSIX_VDISABLE; #endif - - /* Repaint if necessary before each byte is read. This lets us react immediately to universal variable color changes. */ - input_common_set_poll_callback(reader_repaint_if_needed); } @@ -868,12 +865,21 @@ void reader_repaint_if_needed() } } +static void reader_repaint_if_needed_one_arg(void * unused) +{ + reader_repaint_if_needed(); +} + void reader_react_to_color_change() { - if (data) + if (! data) + return; + + if (! data->repaint_needed || ! data->screen_reset_needed) { data->repaint_needed = true; data->screen_reset_needed = true; + input_common_add_callback(reader_repaint_if_needed_one_arg, NULL); } } |