Commit b1314cf9d3119846526eabae6bbd7b8796d22958

Authored by balrog
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,7 +105,7 @@ static void curses_resize(DisplayState *ds, int w, int h)
105 } 105 }
106 106
107 #ifndef _WIN32 107 #ifndef _WIN32
108 -#ifdef SIGWINCH 108 +#if defined(SIGWINCH) && defined(KEY_RESIZE)
109 static void curses_winch_handler(int signum) 109 static void curses_winch_handler(int signum)
110 { 110 {
111 struct winsize { 111 struct winsize {
@@ -186,6 +186,7 @@ static void curses_refresh(DisplayState *ds) @@ -186,6 +186,7 @@ static void curses_refresh(DisplayState *ds)
186 if (chr == ERR) 186 if (chr == ERR)
187 break; 187 break;
188 188
  189 +#ifdef KEY_RESIZE
189 /* this shouldn't occur when we use a custom SIGWINCH handler */ 190 /* this shouldn't occur when we use a custom SIGWINCH handler */
190 if (chr == KEY_RESIZE) { 191 if (chr == KEY_RESIZE) {
191 clear(); 192 clear();
@@ -196,6 +197,7 @@ static void curses_refresh(DisplayState *ds) @@ -196,6 +197,7 @@ static void curses_refresh(DisplayState *ds)
196 ds->height = FONT_HEIGHT * height; 197 ds->height = FONT_HEIGHT * height;
197 continue; 198 continue;
198 } 199 }
  200 +#endif
199 201
200 keycode = curses2keycode[chr]; 202 keycode = curses2keycode[chr];
201 if (keycode == -1) 203 if (keycode == -1)
@@ -346,7 +348,7 @@ void curses_display_init(DisplayState *ds, int full_screen) @@ -346,7 +348,7 @@ void curses_display_init(DisplayState *ds, int full_screen)
346 #ifndef _WIN32 348 #ifndef _WIN32
347 signal(SIGINT, SIG_DFL); 349 signal(SIGINT, SIG_DFL);
348 signal(SIGQUIT, SIG_DFL); 350 signal(SIGQUIT, SIG_DFL);
349 -#ifdef SIGWINCH 351 +#if defined(SIGWINCH) && defined(KEY_RESIZE)
350 /* some curses implementations provide a handler, but we 352 /* some curses implementations provide a handler, but we
351 * want to be sure this is handled regardless of the library */ 353 * want to be sure this is handled regardless of the library */
352 signal(SIGWINCH, curses_winch_handler); 354 signal(SIGWINCH, curses_winch_handler);