aboutsummaryrefslogtreecommitdiffstats
path: root/terms.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-16 05:55:07 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-16 05:55:07 +0000
commite0a73e85846362c77f3d6c83b1bd588f9c51cff9 (patch)
treec9c3234866c08925d7ad071d8735bca521742842 /terms.c
parentChangeLog update (diff)
downloadw3m-e0a73e85846362c77f3d6c83b1bd588f9c51cff9.tar.gz
w3m-e0a73e85846362c77f3d6c83b1bd588f9c51cff9.zip
fix mouse handling on TERM=linux
Diffstat (limited to '')
-rw-r--r--terms.c20
1 files changed, 12 insertions, 8 deletions
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;
}