Mercurial > mxe-octave
view src/readline-1-sigwinch.patch @ 4601:dc3eb553f5e9
update UPDATE rule for sourceforge projects with version directories
* src/cppunit.mk, src/cunit.mk, src/expat.mk, src/freeimage.mk, src/freetype.mk,
src/gnuplot.mk, src/graphicsmagick.mk, src/hunspell.mk, src/id3lib.mk, src/lcms.mk,
src/libircclient.mk, src/liblo.mk, src/libmad.mk, src/libmng.mk, src/libmodplug.mk,
src/libusb.mk, src/matio.mk, src/pcre.mk, src/pdcurses.mk, src/pfstools.mk,
src/plotmm.mk, src/qjson.mk, src/qwt.mk, src/qwtplot3d.mk, src/sdl_pango.mk,
src/sox.mk, src/tinyxml.mk, src/xmlwrapp.mk:
update UPDATE rule for sourceforge projects with version directories
* src/llvm.mk: update use wget not WGE so get uncompressed file)
author | John D |
---|---|
date | Mon, 29 Jan 2018 11:57:20 -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; }