--- gpm-1.20.1/configure.in.vns 2007-09-11 11:09:08 +0400 +++ gpm-1.20.1/configure.in 2007-09-11 11:09:08 +0400 @@ -59,7 +59,7 @@ else lispdir='${datadir}/emacs/site-lisp' fi -AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h) +AC_CHECK_HEADERS(syslog.h linux/input.h linux/joystick.h ncurses.h ncurses/curses.h curses.h term.h) AC_ARG_WITH(curses, [ --without-curses disable curses support even if curses found]) --- gpm-1.20.1/src/lib/liblow.c.vns 2007-09-11 11:09:08 +0400 +++ gpm-1.20.1/src/lib/liblow.c 2007-09-11 11:37:21 +0400 @@ -46,6 +46,12 @@ #include /* KDGETMODE */ #include /* winsize */ +#ifdef HAVE_TERM_H +#include +#include +#undef buttons +#endif /* HAVE_TERM_H */ + #include "headers/gpmInt.h" #include "headers/message.h" @@ -203,14 +209,40 @@ int Gpm_Open(Gpm_Connect *conn, int flag gpm_report(GPM_PR_DEBUG,"VC: %d",flag); + if ((term=(char*)getenv("TERM")) && strncmp(term,"linux",5)) { /*....................................... First of all, check xterm */ +#ifdef HAVE_TERM_H + TERMINAL *old_term = cur_term; + char *mousecap; + + if (setupterm((char *) 0, 1, 0) == OK) + { + if ((mousecap=tigetstr("kmous")) && mousecap != (char *)-1 && mousecap && mousecap[0]) + { +#else /* ! HAVE_TERM_H */ + if (!strncmp(term,"xterm",5)) + { +#endif /* HAVE_TERM_H */ - if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) { - if(gpm_tried) return gpm_fd; /* no stack */ - gpm_fd=-2; - GPM_XTERM_ON; - gpm_flag=1; - return gpm_fd; + if(gpm_tried) return gpm_fd; /* no stack */ + gpm_fd=-2; + GPM_XTERM_ON; + gpm_flag=1; + return gpm_fd; + +#ifdef HAVE_TERM_H + } + if (cur_term != old_term) /* in 5.4 release curses made optimization */ + { + del_curterm(cur_term); + set_curterm(old_term); + } + } +#else + } +#endif /* HAVE_TERM_H */ + gpm_flag=0; + return -1; } /*....................................... No xterm, go on */