diff options
author | Timo Sirainen <cras@irssi.org> | 2001-08-28 12:24:46 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-08-28 12:24:46 +0000 |
commit | 6597d2d1c6804027ddd3fcf7ae1c05bc9a1a2e1f (patch) | |
tree | e1646fdf796cd5bb5f68b7b5bad980215015f09a /src | |
parent | d1e0a0f44f1d4742daa4ebd3a29e563bd532129f (diff) | |
download | irssi-6597d2d1c6804027ddd3fcf7ae1c05bc9a1a2e1f.zip |
Added command /RESIZE for resizing the terminal when SIGWINCH isn't supported.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1772 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/screen.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fe-text/screen.c b/src/fe-text/screen.c index 600958e8..5d3e1f38 100644 --- a/src/fe-text/screen.c +++ b/src/fe-text/screen.c @@ -22,6 +22,7 @@ #include "signals.h" #include "misc.h" #include "settings.h" +#include "commands.h" #include "screen.h" #include "gui-readline.h" @@ -65,8 +66,10 @@ static int init_screen_int(void); static void deinit_screen_int(void); #ifdef SIGWINCH +static int resize_timeout_tag; +#endif -static int resize_timeout_tag, resize_needed; +static int resize_needed; static int resize_timeout(void) { @@ -108,12 +111,19 @@ static int resize_timeout(void) return TRUE; } +#ifdef SIGWINCH static void sig_winch(int p) { resize_needed = TRUE; } #endif +static void cmd_resize(void) +{ + resize_needed = TRUE; + resize_timeout(); +} + static void read_settings(void) { int old_colors = use_colors; @@ -210,6 +220,7 @@ int init_screen(void) signal_add("beep", (SIGNAL_FUNC) beep); signal_add("setup changed", (SIGNAL_FUNC) read_settings); + command_bind("resize", NULL, (SIGNAL_FUNC) cmd_resize); #ifdef SIGWINCH resize_timeout_tag = g_timeout_add(RESIZE_TIMEOUT, @@ -227,6 +238,7 @@ void deinit_screen(void) g_source_remove(resize_timeout_tag); #endif + command_unbind("resize", (SIGNAL_FUNC) cmd_resize); signal_remove("beep", (SIGNAL_FUNC) beep); signal_remove("setup changed", (SIGNAL_FUNC) read_settings); } |