[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>
This commit is contained in:
Fumitoshi UKAI
2002-11-26 03:42:28 +00:00
parent 5ea0255a68
commit 5ca2ac597b
2 changed files with 31 additions and 6 deletions

View File

@@ -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> 2002-11-26 Fumitoshi UKAI <ukai@debian.or.jp>
* NEWS: func: CLOSE_TAB_MOUSE, MENU_MOUSE, MOVE_MOUSE, TAB_MOUSE * NEWS: func: CLOSE_TAB_MOUSE, MENU_MOUSE, MOVE_MOUSE, TAB_MOUSE
@@ -5148,4 +5156,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.557 2002/11/26 02:21:14 ukai Exp $ $Id: ChangeLog,v 1.558 2002/11/26 03:42:28 ukai Exp $

27
main.c
View File

@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.154 2002/11/25 16:59:07 ukai Exp $ */ /* $Id: main.c,v 1.155 2002/11/26 03:42:28 ukai Exp $ */
#define MAINPROGRAM #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <signal.h> #include <signal.h>
@@ -4864,14 +4864,26 @@ do_mouse_action(int btn, int x, int y)
#endif /* JP_CHARSET */ #endif /* JP_CHARSET */
)) { )) {
if (retrieveCurrentAnchor(Currentbuf) || if (retrieveCurrentAnchor(Currentbuf) ||
retrieveCurrentForm(Currentbuf)) retrieveCurrentForm(Currentbuf)) {
map = &mouse_action.active_map[btn]; map = &mouse_action.active_map[btn];
if (!(map && map->func))
map = &mouse_action.anchor_map[btn];
}
} }
else { else {
int cx = Currentbuf->cursorX, cy = Currentbuf->cursorY; int cx = Currentbuf->cursorX, cy = Currentbuf->cursorY;
cursorXY(Currentbuf, x - Currentbuf->rootX, y - Currentbuf->rootY); cursorXY(Currentbuf, x - Currentbuf->rootX, y - Currentbuf->rootY);
if (retrieveCurrentAnchor(Currentbuf) || if (y == Currentbuf->cursorY + Currentbuf->rootY &&
retrieveCurrentForm(Currentbuf)) (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]; map = &mouse_action.anchor_map[btn];
cursorXY(Currentbuf, cx, cy); cursorXY(Currentbuf, cx, cy);
} }
@@ -5112,6 +5124,11 @@ movMs(void)
} }
#ifdef USE_MENU #ifdef USE_MENU
#ifdef KANJI_SYMBOLS
#define FRAME_WIDTH 2
#else
#define FRAME_WIDTH 1
#endif
void void
menuMs(void) menuMs(void)
{ {
@@ -5119,7 +5136,7 @@ menuMs(void)
return; return;
if ((nTab > 1 || mouse_action.menu_str) && if ((nTab > 1 || mouse_action.menu_str) &&
mouse_action.cursorY < LastTab->y + 1) mouse_action.cursorY < LastTab->y + 1)
mouse_action.cursorX -= 2; mouse_action.cursorX -= FRAME_WIDTH + 1;
else if (mouse_action.cursorX >= Currentbuf->rootX && else if (mouse_action.cursorX >= Currentbuf->rootX &&
mouse_action.cursorY < LASTLINE) { mouse_action.cursorY < LASTLINE) {
cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX, cursorXY(Currentbuf, mouse_action.cursorX - Currentbuf->rootX,