Mercurial > mxe-octave
annotate src/readline-1-sigwinch.patch @ 3799:d064c843c7c2
dbus: update to 1.9.10
* src/dbus.mk: update version, checksum
author | John Donoghue |
---|---|
date | Mon, 16 Feb 2015 14:06:56 -0500 |
parents | 2cf09b449d88 |
children |
rev | line source |
---|---|
2980
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 diff -uNr a/readline.c b/readline.c |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 --- a/readline.c 2010-07-25 17:07:40.000000000 -0400 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 +++ b/readline.c 2013-04-17 16:11:52.932653458 -0400 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 @@ -970,6 +970,11 @@ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 rl_initialized++; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 RL_SETSTATE(RL_STATE_INITIALIZED); |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 +#if defined (__MINGW32__) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 + else |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 + /* In case the console window has been resized outside of readline */ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 + rl_reset_screen_size (); |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 +#endif |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 /* Initalize the current line information. */ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 _rl_init_line_state (); |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 diff -uNr a/signals.c b/signals.c |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 --- a/signals.c 2011-02-11 10:53:33.000000000 -0500 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 +++ b/signals.c 2013-04-17 16:07:57.476121748 -0400 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 @@ -46,6 +46,11 @@ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 #include "rlprivate.h" |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 +#if defined (__MINGW32__) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 +# define WIN32_LEAN_AND_MEAN |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 +# include <windows.h> |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 +#endif |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 + |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #if defined (HANDLE_SIGNALS) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #if !defined (RETSIGTYPE) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 @@ -91,7 +96,7 @@ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 int rl_catch_signals = 1; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 /* If non-zero, readline will install a signal handler for SIGWINCH. */ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 -#ifdef SIGWINCH |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 +#if defined (SIGWINCH) || defined (__MINGW32__) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 int rl_catch_sigwinch = 1; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 #else |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 @@ -422,6 +427,21 @@ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 #endif /* SIGWINCH */ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 +#if defined (__MINGW32__) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 + if (rl_catch_sigwinch && sigwinch_set_flag == 0) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 + { |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 + DWORD mode; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 + |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 + if (GetConsoleMode (hStdIn, &mode)) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 + { |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 + mode |= ENABLE_WINDOW_INPUT; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 + if (SetConsoleMode (hStdIn, mode)) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 + sigwinch_set_flag = 1; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 + } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 + } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 +#endif |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 + |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 return 0; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 @@ -467,6 +487,21 @@ |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 #endif |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 +#if defined (__MINGW32__) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 + if (rl_catch_sigwinch && sigwinch_set_flag == 1) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 + { |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 + DWORD mode; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 + HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE); |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 + |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 + if (GetConsoleMode (hStdIn, &mode)) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 + { |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 + mode &= ~ENABLE_WINDOW_INPUT; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 + if (SetConsoleMode (hStdIn, mode)) |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 + sigwinch_set_flag = 0; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 + } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 + } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 +#endif |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 + |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 return 0; |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 } |
2cf09b449d88
readline patches for windows from goffioul
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 |