Fix the mouse menus not working with new backend, and
specifically problms in help and browser routines. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4222 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
17436ce817
commit
c0b7872e26
|
@ -125,15 +125,9 @@ char *do_browser(char *path, DIR *dir)
|
||||||
old_selected = selected;
|
old_selected = selected;
|
||||||
|
|
||||||
kbinput = get_kbinput(edit, &meta_key, &func_key);
|
kbinput = get_kbinput(edit, &meta_key, &func_key);
|
||||||
parse_browser_input(&kbinput, &meta_key, &func_key);
|
|
||||||
s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
|
|
||||||
if (!s)
|
|
||||||
continue;
|
|
||||||
f = sctofunc((sc *) s);
|
|
||||||
if (!f)
|
|
||||||
break;
|
|
||||||
#ifndef DISABLE_MOUSE
|
#ifndef DISABLE_MOUSE
|
||||||
if (f->scfunc == (void *) do_mouse) {
|
if (kbinput == KEY_MOUSE) {
|
||||||
|
|
||||||
int mouse_x, mouse_y;
|
int mouse_x, mouse_y;
|
||||||
|
|
||||||
|
@ -164,8 +158,17 @@ char *do_browser(char *path, DIR *dir)
|
||||||
if (old_selected == selected)
|
if (old_selected == selected)
|
||||||
unget_kbinput(NANO_ENTER_KEY, FALSE, FALSE);
|
unget_kbinput(NANO_ENTER_KEY, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
#endif /* !DISABLE_MOUSE */
|
#endif /* !DISABLE_MOUSE */
|
||||||
|
|
||||||
|
parse_browser_input(&kbinput, &meta_key, &func_key);
|
||||||
|
s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
|
||||||
|
if (!s)
|
||||||
|
continue;
|
||||||
|
f = sctofunc((sc *) s);
|
||||||
|
if (!f)
|
||||||
|
break;
|
||||||
|
|
||||||
if (f->scfunc == total_refresh) {
|
if (f->scfunc == total_refresh) {
|
||||||
total_redraw();
|
total_redraw();
|
||||||
} else if (f->scfunc == do_help_void) {
|
} else if (f->scfunc == do_help_void) {
|
||||||
|
|
21
src/help.c
21
src/help.c
|
@ -127,8 +127,17 @@ void do_help(void (*refresh_func)(void))
|
||||||
old_line = line;
|
old_line = line;
|
||||||
|
|
||||||
kbinput = get_kbinput(edit, &meta_key, &func_key);
|
kbinput = get_kbinput(edit, &meta_key, &func_key);
|
||||||
parse_help_input(&kbinput, &meta_key, &func_key);
|
|
||||||
|
|
||||||
|
#ifndef DISABLE_MOUSE
|
||||||
|
if (kbinput == KEY_MOUSE) {
|
||||||
|
int mouse_x, mouse_y;
|
||||||
|
get_mouseinput(&mouse_x, &mouse_y, TRUE);
|
||||||
|
continue;
|
||||||
|
/* Redraw the screen. */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
parse_help_input(&kbinput, &meta_key, &func_key);
|
||||||
s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
|
s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
|
||||||
if (!s)
|
if (!s)
|
||||||
continue;
|
continue;
|
||||||
|
@ -136,15 +145,7 @@ void do_help(void (*refresh_func)(void))
|
||||||
if (!f)
|
if (!f)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (f->scfunc == total_refresh) {
|
||||||
if (f->scfunc == (void *) do_mouse) {
|
|
||||||
#ifndef DISABLE_MOUSE
|
|
||||||
int mouse_x, mouse_y;
|
|
||||||
|
|
||||||
get_mouseinput(&mouse_x, &mouse_y, TRUE);
|
|
||||||
#endif
|
|
||||||
/* Redraw the screen. */
|
|
||||||
} else if (f->scfunc == total_refresh) {
|
|
||||||
total_redraw();
|
total_redraw();
|
||||||
break;
|
break;
|
||||||
} else if (f->scfunc == do_page_up) {
|
} else if (f->scfunc == do_page_up) {
|
||||||
|
|
11
src/winio.c
11
src/winio.c
|
@ -1695,14 +1695,19 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
|
||||||
* we released/clicked on. */
|
* we released/clicked on. */
|
||||||
f = allfuncs;
|
f = allfuncs;
|
||||||
|
|
||||||
for (; j > 0; j--)
|
for (; j > 0; j--) {
|
||||||
while (f != NULL && (f->menus & currmenu) != 0)
|
if (f->next != NULL)
|
||||||
|
f = f->next;
|
||||||
|
while (f->next != NULL && (f->menus & currmenu) == 0)
|
||||||
f = f->next;
|
f = f->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* And put back the equivalent key. */
|
/* And put back the equivalent key. */
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
const sc *s = first_sc_for(currmenu, (void *) f->scfunc);
|
const sc *s = first_sc_for(currmenu, (void *) f->scfunc);
|
||||||
unget_kbinput(s->seq, s->type == META, FALSE);
|
if (s != NULL)
|
||||||
|
unget_kbinput(s->seq, s->type == META, FALSE);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
/* Handle releases/clicks of the first mouse button that
|
/* Handle releases/clicks of the first mouse button that
|
||||||
|
|
Loading…
Reference in New Issue