aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-03 13:49:58 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-04-03 13:49:58 -0700
commit1543d02f96bdf96a067e96742577ea740dda4d89 (patch)
tree455d72f7cc027ab3dde815662222675331b2261f /reader.cpp
parent11a444e914820bd8dc9a0f2e87e2585137af713b (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.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/reader.cpp b/reader.cpp
index 0f47de69..17c3583c 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -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);
}
}