aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog6
-rw-r--r--terms.c20
2 files changed, 18 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a124ff..055efb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/terms.c b/terms.c
index 220b72c..fca63ab 100644
--- a/terms.c
+++ b/terms.c
@@ -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;
}