diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-16 17:38:35 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-16 17:38:35 +0000 |
commit | 225a3fb8aa2dc9ff06ae652f54a6411bcdb1204b (patch) | |
tree | 26adfbcf732abdcdba6da518791eb113e0bbc80d | |
parent | [w3m-dev 02418] (diff) | |
download | w3m-225a3fb8aa2dc9ff06ae652f54a6411bcdb1204b.tar.gz w3m-225a3fb8aa2dc9ff06ae652f54a6411bcdb1204b.zip |
tgetstr("Km", &pt) cannot be used to detect is_xterminu-0-2-2-base
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | terms.c | 23 |
2 files changed, 16 insertions, 13 deletions
@@ -1,3 +1,9 @@ +2001-11-17 Fumitoshi UKAI <ukai@debian.or.jp> + + * terms.c (set_tty): "rxvt" is xterm + (getTCstr): tgetstr("Km", &pt) is not xterm, removed + (mouse_init): check Gpm_Open() == -2 to detect xterm when USE_GPM + 2001-11-16 Tsutomu Okada <okada@furuno.co.jp> * main.c (chkURL): add mailto: like pattern to mark as anchor @@ -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; } |