forked from Mirrors/sngrep
ncurses: read first input before screen display
This commit is contained in:
parent
29163354ec
commit
2582d57465
|
@ -552,8 +552,11 @@ ncurses_init(GMainLoop *loop, GError **error)
|
||||||
// Create the first displayed window
|
// Create the first displayed window
|
||||||
ncurses_create_window(WINDOW_CALL_LIST);
|
ncurses_create_window(WINDOW_CALL_LIST);
|
||||||
|
|
||||||
|
// Hack: First readed key before screen display causes ESC key to be read
|
||||||
|
ncurses_read_input(STDERR_FILENO, G_IO_IN, loop);
|
||||||
|
|
||||||
// Source for reading events from stdin
|
// Source for reading events from stdin
|
||||||
GSource *source = g_unix_fd_source_new(fileno(stdin), G_IO_IN | G_IO_ERR | G_IO_HUP);
|
GSource *source = g_unix_fd_source_new(STDIN_FILENO, G_IO_IN | G_IO_ERR | G_IO_HUP);
|
||||||
g_source_set_callback(source, (GSourceFunc) ncurses_read_input, loop, NULL);
|
g_source_set_callback(source, (GSourceFunc) ncurses_read_input, loop, NULL);
|
||||||
g_source_attach(source, NULL);
|
g_source_attach(source, NULL);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define __SNGREP_WINDOW_H
|
#define __SNGREP_WINDOW_H
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <ncursesw/ncurses.h>
|
#include <ncurses.h>
|
||||||
#include <panel.h>
|
#include <panel.h>
|
||||||
#include <form.h>
|
#include <form.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue