Mercurial > mxe-octave
view src/readline-1-sigwinch.patch @ 4538:979f5b397e51
maint: update PKG_UPDATE targets
* src/boost.mk: update UPDATE target, use https
* src/cmake.mk: add usable UPDATE target
* src/double-conversion.mk: add usable UPDATE target
* src/dri2proto.mk: add PKG_UPDATE
* src/exiv2.mk: update UPDATE for archives
* src/fribidi.mk: update UPDATE for github
* src/glproto.mk: add PKG_UPDATE
* src/glu.mk: add PKG_UPDATE
* src/levmar.mk: add user-agent to UPDATE
* src/libarchive.mk: update UPDATE for website
* src/libass.mk: update UPDATE for github
* src/libdrm.mk: add PKG_UPDATE
* src/libffi.mk: update for webpage changes
* src/libgee.mk: update for gnome page changes
* src/libgsf.mk: update for gnome page changes
* src/libidn2.mk: correct PKG_UPDATE
author | John D |
---|---|
date | Tue, 21 Nov 2017 12:03:47 -0500 |
parents | 2cf09b449d88 |
children |
line wrap: on
line source
diff -uNr a/readline.c b/readline.c --- a/readline.c 2010-07-25 17:07:40.000000000 -0400 +++ b/readline.c 2013-04-17 16:11:52.932653458 -0400 @@ -970,6 +970,11 @@ rl_initialized++; RL_SETSTATE(RL_STATE_INITIALIZED); } +#if defined (__MINGW32__) + else + /* In case the console window has been resized outside of readline */ + rl_reset_screen_size (); +#endif /* Initalize the current line information. */ _rl_init_line_state (); diff -uNr a/signals.c b/signals.c --- a/signals.c 2011-02-11 10:53:33.000000000 -0500 +++ b/signals.c 2013-04-17 16:07:57.476121748 -0400 @@ -46,6 +46,11 @@ #include "rlprivate.h" +#if defined (__MINGW32__) +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +#endif + #if defined (HANDLE_SIGNALS) #if !defined (RETSIGTYPE) @@ -91,7 +96,7 @@ int rl_catch_signals = 1; /* If non-zero, readline will install a signal handler for SIGWINCH. */ -#ifdef SIGWINCH +#if defined (SIGWINCH) || defined (__MINGW32__) int rl_catch_sigwinch = 1; #else int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ @@ -422,6 +427,21 @@ } #endif /* SIGWINCH */ +#if defined (__MINGW32__) + if (rl_catch_sigwinch && sigwinch_set_flag == 0) + { + DWORD mode; + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); + + if (GetConsoleMode (hStdIn, &mode)) + { + mode |= ENABLE_WINDOW_INPUT; + if (SetConsoleMode (hStdIn, mode)) + sigwinch_set_flag = 1; + } + } +#endif + return 0; } @@ -467,6 +487,21 @@ } #endif +#if defined (__MINGW32__) + if (rl_catch_sigwinch && sigwinch_set_flag == 1) + { + DWORD mode; + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); + + if (GetConsoleMode (hStdIn, &mode)) + { + mode &= ~ENABLE_WINDOW_INPUT; + if (SetConsoleMode (hStdIn, mode)) + sigwinch_set_flag = 0; + } + } +#endif + return 0; }