aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-09-25 18:07:19 +0300
committerEli Zaretskii2013-09-25 18:07:19 +0300
commitbbc108377873aa6ed7cf21c731770103096eea39 (patch)
tree1484c953e915775c198ce8a284dee9dfa4038de5 /src
parente648f6997511f3a4cabc338783e61ad076074859 (diff)
downloademacs-bbc108377873aa6ed7cf21c731770103096eea39.tar.gz
emacs-bbc108377873aa6ed7cf21c731770103096eea39.zip
Menu movement by mouse and keyboard live in peace now.
Diffstat (limited to 'src')
-rw-r--r--src/term.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/term.c b/src/term.c
index a7c111f46ef..830ecf10dcb 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2938,35 +2938,11 @@ mouse_get_xy (int *x, int *y)
2938 2938
2939static void 2939static void
2940tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces, 2940tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces,
2941 int disp_help) 2941 int mx, int my, int disp_help)
2942{ 2942{
2943 int i, face, width, mx = -1, my = -1, enabled, mousehere, row, col; 2943 int i, face, width, enabled, mousehere, row, col;
2944 struct frame *sf = SELECTED_FRAME (); 2944 struct frame *sf = SELECTED_FRAME ();
2945 struct tty_display_info *tty = FRAME_TTY (sf); 2945 struct tty_display_info *tty = FRAME_TTY (sf);
2946#if defined (WINDOWSNT) || defined (HAVE_GPM)
2947 Lisp_Object lmx, lmy, lisp_dummy;
2948 enum scroll_bar_part part_dummy;
2949 Time time_dummy;
2950
2951 if (FRAME_TERMINAL (sf)->mouse_position_hook)
2952 (*FRAME_TERMINAL (sf)->mouse_position_hook) (&sf, -1,
2953 &lisp_dummy, &part_dummy,
2954 &lmx, &lmy,
2955 &time_dummy);
2956 if (!NILP (lmx))
2957 {
2958 mx = XINT (lmx);
2959 my = XINT (lmy);
2960 }
2961 else
2962 {
2963 mx = menu_x;
2964 my = menu_y;
2965 }
2966#else
2967 mx = menu_x;
2968 my = menu_y;
2969#endif
2970 2946
2971 menu_help_message = NULL; 2947 menu_help_message = NULL;
2972 2948
@@ -3418,7 +3394,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3418 want to interpret them as zero-based column and row coordinates, 3394 want to interpret them as zero-based column and row coordinates,
3419 and also because we want the first item of the menu, not its 3395 and also because we want the first item of the menu, not its
3420 title, to appear at x0,y0. */ 3396 title, to appear at x0,y0. */
3421 tty_menu_display (menu, x0 - 1, y0 - 1, 1, title_faces, 0); 3397 tty_menu_display (menu, x0 - 1, y0 - 1, 1, title_faces, x0 - 1, y0 - 1, 0);
3422 if (buffers_num_deleted) 3398 if (buffers_num_deleted)
3423 menu->text[0][7] = ' '; 3399 menu->text[0][7] = ' ';
3424 if ((onepane = menu->count == 1 && menu->submenu[0])) 3400 if ((onepane = menu->count == 1 && menu->submenu[0]))
@@ -3495,7 +3471,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3495 state[i].x, 3471 state[i].x,
3496 state[i].y, 3472 state[i].y,
3497 state[i].pane, 3473 state[i].pane,
3498 faces, 1); 3474 faces, x, y, 1);
3499 state[statecount].menu = state[i].menu->submenu[dy]; 3475 state[statecount].menu = state[i].menu->submenu[dy];
3500 state[statecount].pane = state[i].menu->panenumber[dy]; 3476 state[statecount].pane = state[i].menu->panenumber[dy];
3501 mouse_off (); /* FIXME */ 3477 mouse_off (); /* FIXME */
@@ -3512,7 +3488,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3512 state[statecount - 1].x, 3488 state[statecount - 1].x,
3513 state[statecount - 1].y, 3489 state[statecount - 1].y,
3514 state[statecount - 1].pane, 3490 state[statecount - 1].pane,
3515 faces, 1); 3491 faces, x, y, 1);
3516 } 3492 }
3517 3493
3518 /* Display the help-echo message for the currently-selected menu 3494 /* Display the help-echo message for the currently-selected menu