Commit b1314cf9d3119846526eabae6bbd7b8796d22958
1 parent
7089442c
The non-ncurses curses doesn't have resize_term, so make resizing conditional.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3986 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
2 deletions
curses.c
... | ... | @@ -105,7 +105,7 @@ static void curses_resize(DisplayState *ds, int w, int h) |
105 | 105 | } |
106 | 106 | |
107 | 107 | #ifndef _WIN32 |
108 | -#ifdef SIGWINCH | |
108 | +#if defined(SIGWINCH) && defined(KEY_RESIZE) | |
109 | 109 | static void curses_winch_handler(int signum) |
110 | 110 | { |
111 | 111 | struct winsize { |
... | ... | @@ -186,6 +186,7 @@ static void curses_refresh(DisplayState *ds) |
186 | 186 | if (chr == ERR) |
187 | 187 | break; |
188 | 188 | |
189 | +#ifdef KEY_RESIZE | |
189 | 190 | /* this shouldn't occur when we use a custom SIGWINCH handler */ |
190 | 191 | if (chr == KEY_RESIZE) { |
191 | 192 | clear(); |
... | ... | @@ -196,6 +197,7 @@ static void curses_refresh(DisplayState *ds) |
196 | 197 | ds->height = FONT_HEIGHT * height; |
197 | 198 | continue; |
198 | 199 | } |
200 | +#endif | |
199 | 201 | |
200 | 202 | keycode = curses2keycode[chr]; |
201 | 203 | if (keycode == -1) |
... | ... | @@ -346,7 +348,7 @@ void curses_display_init(DisplayState *ds, int full_screen) |
346 | 348 | #ifndef _WIN32 |
347 | 349 | signal(SIGINT, SIG_DFL); |
348 | 350 | signal(SIGQUIT, SIG_DFL); |
349 | -#ifdef SIGWINCH | |
351 | +#if defined(SIGWINCH) && defined(KEY_RESIZE) | |
350 | 352 | /* some curses implementations provide a handler, but we |
351 | 353 | * want to be sure this is handled regardless of the library */ |
352 | 354 | signal(SIGWINCH, curses_winch_handler); | ... | ... |