mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
send_event(): initialize @doc_view only when needed, and prevent a
useless test for mouse event when event is of keyboard type.
This commit is contained in:
parent
59c8dcc473
commit
c769b81f93
@ -1185,22 +1185,23 @@ quit:
|
||||
void
|
||||
send_event(struct session *ses, struct term_event *ev)
|
||||
{
|
||||
struct document_view *doc_view;
|
||||
|
||||
assert(ses && ev);
|
||||
if_assert_failed return;
|
||||
doc_view = current_frame(ses);
|
||||
|
||||
if (ev->ev == EVENT_KBD) {
|
||||
struct document_view *doc_view = current_frame(ses);
|
||||
|
||||
ses = send_kbd_event(ses, doc_view, ev);
|
||||
}
|
||||
#ifdef CONFIG_MOUSE
|
||||
if (ev->ev == EVENT_MOUSE) {
|
||||
else if (ev->ev == EVENT_MOUSE) {
|
||||
struct document_view *doc_view = current_frame(ses);
|
||||
|
||||
ses = send_mouse_event(ses, doc_view, ev);
|
||||
}
|
||||
#endif /* CONFIG_MOUSE */
|
||||
|
||||
/* ses may disappear ie. in close_tab() */
|
||||
/* @ses may disappear ie. in close_tab() */
|
||||
if (ses) ses->kbdprefix.repeat_count = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user