mirror of https://github.com/xemu-project/xemu.git
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
This commit is contained in:
parent
7089442cb6
commit
b1314cf9d3
6
curses.c
6
curses.c
|
@ -105,7 +105,7 @@ static void curses_resize(DisplayState *ds, int w, int h)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#ifdef SIGWINCH
|
#if defined(SIGWINCH) && defined(KEY_RESIZE)
|
||||||
static void curses_winch_handler(int signum)
|
static void curses_winch_handler(int signum)
|
||||||
{
|
{
|
||||||
struct winsize {
|
struct winsize {
|
||||||
|
@ -186,6 +186,7 @@ static void curses_refresh(DisplayState *ds)
|
||||||
if (chr == ERR)
|
if (chr == ERR)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef KEY_RESIZE
|
||||||
/* this shouldn't occur when we use a custom SIGWINCH handler */
|
/* this shouldn't occur when we use a custom SIGWINCH handler */
|
||||||
if (chr == KEY_RESIZE) {
|
if (chr == KEY_RESIZE) {
|
||||||
clear();
|
clear();
|
||||||
|
@ -196,6 +197,7 @@ static void curses_refresh(DisplayState *ds)
|
||||||
ds->height = FONT_HEIGHT * height;
|
ds->height = FONT_HEIGHT * height;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
keycode = curses2keycode[chr];
|
keycode = curses2keycode[chr];
|
||||||
if (keycode == -1)
|
if (keycode == -1)
|
||||||
|
@ -346,7 +348,7 @@ void curses_display_init(DisplayState *ds, int full_screen)
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
signal(SIGINT, SIG_DFL);
|
signal(SIGINT, SIG_DFL);
|
||||||
signal(SIGQUIT, SIG_DFL);
|
signal(SIGQUIT, SIG_DFL);
|
||||||
#ifdef SIGWINCH
|
#if defined(SIGWINCH) && defined(KEY_RESIZE)
|
||||||
/* some curses implementations provide a handler, but we
|
/* some curses implementations provide a handler, but we
|
||||||
* want to be sure this is handled regardless of the library */
|
* want to be sure this is handled regardless of the library */
|
||||||
signal(SIGWINCH, curses_winch_handler);
|
signal(SIGWINCH, curses_winch_handler);
|
||||||
|
|
Loading…
Reference in New Issue