diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-16 05:55:07 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-16 05:55:07 +0000 |
commit | e0a73e85846362c77f3d6c83b1bd588f9c51cff9 (patch) | |
tree | c9c3234866c08925d7ad071d8735bca521742842 | |
parent | ChangeLog update (diff) | |
download | w3m-e0a73e85846362c77f3d6c83b1bd588f9c51cff9.tar.gz w3m-e0a73e85846362c77f3d6c83b1bd588f9c51cff9.zip |
fix mouse handling on TERM=linux
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | terms.c | 20 |
2 files changed, 18 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2001-11-16 Fumitoshi UKAI <ukai@debian.or.jp> + + * terms.c (mouse_init): fix mouse handling on TERM=linux + if Gpm_Open() successed, set is_xterm = 0 so that + w3m uses gpm functions. + 2001-11-16 Tsutomu Okada <okada@furuno.co.jp> * file.c (HTMLtagproc1): [w3m-dev 02408] meta refresh @@ -1,4 +1,4 @@ -/* $Id: terms.c,v 1.3 2001/11/15 00:32:13 a-ito Exp $ */ +/* $Id: terms.c,v 1.4 2001/11/16 05:55:07 ukai Exp $ */ /* * An original curses library for EUC-kanji by Akinori ITO, December 1989 * revised by Akinori ITO, January 1995 @@ -1717,14 +1717,18 @@ mouse_init() if (is_xterm) { XTERM_ON; } - else { - conn.eventMask = ~0; - conn.defaultMask = 0; - conn.maxMod = 0; - conn.minMod = 0; - Gpm_Open(&conn, 0); /* don't care even if it fails */ - gpm_handler = gpm_process_mouse; + conn.eventMask = ~0; + conn.defaultMask = 0; + conn.maxMod = 0; + conn.minMod = 0; + if (Gpm_Open(&conn, 0) >= 0) { + /* + * If Gpm_Open() success, returns >= 0 + * Gpm_Open() returns -2 in case of xterm. + */ + is_xterm = 0; } + gpm_handler = gpm_process_mouse; mouseActive = 1; } |