w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 4b40bf6bd50b62afebe01acd761b127bf63b4874
parent 202ed20fd0b3233e8be5a90705a89c7fbd6c0441
Author: ukai <ukai>
Date:   Tue, 26 Nov 2002 03:42:28 +0000

[w3m-dev 03485] fix mouse menu position
* main.c (do_mouse_action): use anchor_map is no active_map
		check top left corner
	(FRAME_WIDTH): added
	(menuMs): adjust cursorX using FRAME_WIDTH
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>

Diffstat:
MChangeLog | 8++++++++
Mmain.c | 25+++++++++++++++++++++----
2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,11 @@ +2002-11-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03485] fix mouse menu position + * main.c (do_mouse_action): use anchor_map is no active_map + check top left corner + (FRAME_WIDTH): added + (menuMs): adjust cursorX using FRAME_WIDTH + 2002-11-26 Fumitoshi UKAI <ukai@debian.or.jp> * NEWS: func: CLOSE_TAB_MOUSE, MENU_MOUSE, MOVE_MOUSE, TAB_MOUSE diff --git a/main.c b/main.c @@ -4864,14 +4864,26 @@ do_mouse_action(int btn, int x, int y) #endif /* JP_CHARSET */ )) { if (retrieveCurrentAnchor(Currentbuf) || - retrieveCurrentForm(Currentbuf)) + retrieveCurrentForm(Currentbuf)) { map = &mouse_action.active_map[btn]; + if (!(map && map->func)) + map = &mouse_action.anchor_map[btn]; + } } else { int cx = Currentbuf->cursorX, cy = Currentbuf->cursorY; cursorXY(Currentbuf, x - Currentbuf->rootX, y - Currentbuf->rootY); - if (retrieveCurrentAnchor(Currentbuf) || - retrieveCurrentForm(Currentbuf)) + if (y == Currentbuf->cursorY + Currentbuf->rootY && + (x == Currentbuf->cursorX + Currentbuf->rootX +#ifdef JP_CHARSET + || (Currentbuf->currentLine != NULL && + (Currentbuf->currentLine-> + propBuf[Currentbuf->pos] & PC_KANJI1) + && x == Currentbuf->cursorX + Currentbuf->rootX + 1) +#endif /* JP_CHARSET */ + ) && + (retrieveCurrentAnchor(Currentbuf) || + retrieveCurrentForm(Currentbuf))) map = &mouse_action.anchor_map[btn]; cursorXY(Currentbuf, cx, cy); } @@ -5112,6 +5124,11 @@ movMs(void) } #ifdef USE_MENU +#ifdef KANJI_SYMBOLS +#define FRAME_WIDTH 2 +#else +#define FRAME_WIDTH 1 +#endif void menuMs(void) { @@ -5119,7 +5136,7 @@ menuMs(void) return; if ((nTab > 1 || mouse_action.menu_str) && mouse_action.cursorY < LastTab->y + 1) - mouse_action.cursorX -= 2; + mouse_action.cursorX -= FRAME_WIDTH + 1; else if (mouse_action.cursorX >= Currentbuf->rootX && mouse_action.cursorY < LASTLINE) { cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX,