[w3m-dev 02666] resizing on xterm with gpm support

From: Fumitoshi UKAI  <ukai@debian.or.jp>
This commit is contained in:
Fumitoshi UKAI
2001-12-15 18:33:41 +00:00
parent 7d210d5c99
commit 7a65c8e698
2 changed files with 15 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
2001-12-16 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 02666] resizing on xterm with gpm support
* terms.c (mouse_init): check Gpm_Open return value, signal(SIGWINCH)
2001-12-16 Rin Okuyama <okuyama@cna.ne.jp> 2001-12-16 Rin Okuyama <okuyama@cna.ne.jp>
* [w3m-dev 02664] install-sh -s option * [w3m-dev 02664] install-sh -s option
@@ -1256,4 +1261,4 @@
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.130 2001/12/15 17:25:45 ukai Exp $ $Id: ChangeLog,v 1.131 2001/12/15 18:33:41 ukai Exp $

13
terms.c
View File

@@ -1,4 +1,4 @@
/* $Id: terms.c,v 1.23 2001/12/14 17:40:09 ukai Exp $ */ /* $Id: terms.c,v 1.24 2001/12/15 18:33:41 ukai Exp $ */
/* /*
* An original curses library for EUC-kanji by Akinori ITO, December 1989 * An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995 * revised by Akinori ITO, January 1995
@@ -2005,6 +2005,7 @@ mouse_init()
{ {
Gpm_Connect conn; Gpm_Connect conn;
extern int gpm_process_mouse(Gpm_Event *, void *); extern int gpm_process_mouse(Gpm_Event *, void *);
int r;
if (mouseActive) if (mouseActive)
return; return;
@@ -2012,7 +2013,9 @@ mouse_init()
conn.defaultMask = 0; conn.defaultMask = 0;
conn.maxMod = 0; conn.maxMod = 0;
conn.minMod = 0; conn.minMod = 0;
if (Gpm_Open(&conn, 0) == -2) {
r = Gpm_Open(&conn, 0);
if (r == -2) {
/* /*
* If Gpm_Open() success, returns >= 0 * If Gpm_Open() success, returns >= 0
* Gpm_Open() returns -2 in case of xterm. * Gpm_Open() returns -2 in case of xterm.
@@ -2021,14 +2024,16 @@ mouse_init()
* passed through to the application. * passed through to the application.
*/ */
Gpm_Close(); Gpm_Close();
is_xterm = 1; is_xterm = (NEED_XTERM_ON|NEED_XTERM_OFF);
} }
else { else if (r >= 0) {
gpm_handler = gpm_process_mouse; gpm_handler = gpm_process_mouse;
is_xterm = 0;
} }
if (is_xterm) { if (is_xterm) {
XTERM_ON; XTERM_ON;
} }
signal(SIGWINCH, resize_hook);
mouseActive = 1; mouseActive = 1;
} }