mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 16:26:21 +00:00
Move SIGWINCH handling to ui/core.c, ignore signal whilst resizing
This commit is contained in:
@@ -204,6 +204,7 @@ _init(const int disable_tls, char *log_level)
|
|||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
signal(SIGTSTP, SIG_IGN);
|
signal(SIGTSTP, SIG_IGN);
|
||||||
|
signal(SIGWINCH, ui_sigwinch_handler);
|
||||||
_create_directories();
|
_create_directories();
|
||||||
log_level_t prof_log_level = log_level_from_string(log_level);
|
log_level_t prof_log_level = log_level_from_string(log_level);
|
||||||
prefs_load();
|
prefs_load();
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ static char *win_title;
|
|||||||
|
|
||||||
static int inp_size;
|
static int inp_size;
|
||||||
|
|
||||||
|
static gboolean perform_resize = FALSE;
|
||||||
|
|
||||||
#ifdef HAVE_LIBXSS
|
#ifdef HAVE_LIBXSS
|
||||||
static Display *display;
|
static Display *display;
|
||||||
#endif
|
#endif
|
||||||
@@ -120,6 +122,12 @@ ui_init(void)
|
|||||||
win_update_virtual(window);
|
win_update_virtual(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ui_sigwinch_handler(int sig)
|
||||||
|
{
|
||||||
|
perform_resize = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_update(void)
|
ui_update(void)
|
||||||
{
|
{
|
||||||
@@ -137,6 +145,13 @@ ui_update(void)
|
|||||||
status_bar_update_virtual();
|
status_bar_update_virtual();
|
||||||
inp_put_back();
|
inp_put_back();
|
||||||
doupdate();
|
doupdate();
|
||||||
|
|
||||||
|
if (perform_resize) {
|
||||||
|
signal(SIGWINCH, SIG_IGN);
|
||||||
|
ui_resize();
|
||||||
|
perform_resize = FALSE;
|
||||||
|
signal(SIGWINCH, ui_sigwinch_handler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ static gboolean cmd_result = TRUE;
|
|||||||
static void _inp_win_update_virtual(void);
|
static void _inp_win_update_virtual(void);
|
||||||
static int _inp_printable(const wint_t ch);
|
static int _inp_printable(const wint_t ch);
|
||||||
static void _inp_win_handle_scroll(void);
|
static void _inp_win_handle_scroll(void);
|
||||||
static void _inp_resize_signal_handler(int signal);
|
|
||||||
static int _inp_offset_to_col(char *str, int offset);
|
static int _inp_offset_to_col(char *str, int offset);
|
||||||
static void _inp_write(char *line, int offset);
|
static void _inp_write(char *line, int offset);
|
||||||
|
|
||||||
@@ -125,8 +124,6 @@ create_input_window(void)
|
|||||||
rl_startup_hook = _inp_rl_startup_hook;
|
rl_startup_hook = _inp_rl_startup_hook;
|
||||||
rl_callback_handler_install(NULL, _inp_rl_linehandler);
|
rl_callback_handler_install(NULL, _inp_rl_linehandler);
|
||||||
|
|
||||||
signal(SIGWINCH, _inp_resize_signal_handler);
|
|
||||||
|
|
||||||
inp_win = newpad(1, INP_WIN_MAX);
|
inp_win = newpad(1, INP_WIN_MAX);
|
||||||
wbkgd(inp_win, theme_attrs(THEME_INPUT_TEXT));;
|
wbkgd(inp_win, theme_attrs(THEME_INPUT_TEXT));;
|
||||||
keypad(inp_win, TRUE);
|
keypad(inp_win, TRUE);
|
||||||
@@ -311,12 +308,6 @@ _inp_offset_to_col(char *str, int offset)
|
|||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_inp_resize_signal_handler(int signal)
|
|
||||||
{
|
|
||||||
ui_resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_inp_win_handle_scroll(void)
|
_inp_win_handle_scroll(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ GSList* ui_get_chat_recipients(void);
|
|||||||
gboolean ui_switch_win(const int i);
|
gboolean ui_switch_win(const int i);
|
||||||
void ui_next_win(void);
|
void ui_next_win(void);
|
||||||
void ui_previous_win(void);
|
void ui_previous_win(void);
|
||||||
|
void ui_sigwinch_handler(int sig);
|
||||||
|
|
||||||
void ui_gone_secure(const char * const barejid, gboolean trusted);
|
void ui_gone_secure(const char * const barejid, gboolean trusted);
|
||||||
void ui_gone_insecure(const char * const barejid);
|
void ui_gone_insecure(const char * const barejid);
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ void ui_smp_answer_failure(const char * const barejid) {}
|
|||||||
|
|
||||||
void ui_otr_authenticating(const char * const barejid) {}
|
void ui_otr_authenticating(const char * const barejid) {}
|
||||||
void ui_otr_authetication_waiting(const char * const recipient) {}
|
void ui_otr_authetication_waiting(const char * const recipient) {}
|
||||||
|
void ui_sigwinch_handler(int sig) {}
|
||||||
|
|
||||||
unsigned long ui_get_idle_time(void)
|
unsigned long ui_get_idle_time(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user