diff options
Diffstat (limited to '')
-rw-r--r-- | terms.c | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -1,4 +1,4 @@ -/* $Id: terms.c,v 1.4 2001/11/16 05:55:07 ukai Exp $ */ +/* $Id: terms.c,v 1.5 2001/11/16 17:38:35 ukai Exp $ */ /* * An original curses library for EUC-kanji by Akinori ITO, December 1989 * revised by Akinori ITO, January 1995 @@ -244,7 +244,8 @@ set_tty(void) TerminalGet(tty, &d_ioval); #ifdef MOUSE term = getenv("TERM"); - if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5)) { + if (!strncmp(term, "kterm", 5) || !strncmp(term, "xterm", 5) || + !strncmp(term, "rxvt", 4)) { is_xterm = 1; } #endif @@ -411,11 +412,6 @@ getTCstr(void) fprintf(stderr, "Can't find termcap entry %s\n", ent); reset_exit(SIGNAL_ARGLIST); } -#ifdef MOUSE - if (tgetstr("Km", &pt)) { - is_xterm = 1; - } -#endif GETSTR(T_ce, "ce"); /* clear to the end of line */ GETSTR(T_cd, "cd"); /* clear to the end of display */ @@ -1714,21 +1710,22 @@ mouse_init() if (mouseActive) return; - if (is_xterm) { - XTERM_ON; - } conn.eventMask = ~0; conn.defaultMask = 0; conn.maxMod = 0; conn.minMod = 0; - if (Gpm_Open(&conn, 0) >= 0) { + if (Gpm_Open(&conn, 0) == -2) { /* * If Gpm_Open() success, returns >= 0 * Gpm_Open() returns -2 in case of xterm. */ - is_xterm = 0; + is_xterm = 1; + } else { + gpm_handler = gpm_process_mouse; + } + if (is_xterm) { + XTERM_ON; } - gpm_handler = gpm_process_mouse; mouseActive = 1; } |