Mercurial > mxe-octave
view src/readline-1-sigwinch.patch @ 3293:cf6f40cededb
Support file list generation in packages.
For the following modules:
- arpack
- blas
- build-autoconf
- build-automake
- build-cmake
- build-gperf
- build-libtool
- build-msvctools
- build-pkg-config
- build-texinfo
- bzip2
- curl
- dbus
- expat
- fftw
- fltk
- fontconfig
- freetype
- gettext
- glpk
- gmp
- gnuplot
- gnutls
- graphicsmagick
- hdf5
- jasper
- jpeg
- lapack
- lcms
- libgcrypt
- libgpg_error
- libiconv
- libidn
- libpng
- libssh2
- libxml2
- ncurses
- nettle
- openssl
- pcre
- pstoedit
- zlib
- qhull
- qrupdate
- qscintilla
- qt
- readline
- suitesparse
- texinfo
- tiff
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Sat, 09 Nov 2013 23:28:04 -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; }