commit 5e23f6c640df44ccf6f6f5ecc91187fecc4ca96a
parent 0c8b764b281f45a044313ff720b8ea2d7d5a667b
Author: ukai <ukai>
Date: Fri, 16 Nov 2001 05:55:07 +0000
fix mouse handling on TERM=linux
Diffstat:
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git 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
@@ -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;
}