1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

Drop EVENT_TEXTAREA, use EVENT_RESIZE instead

When returning from an external program, unblock_itrm_x in the slave process will send a resize event to the master process for the slave terminal.  In handle_interlink_event, when we receive this resize event, we can check whether we need to call textarea_edit.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-09-01 12:46:02 +00:00 committed by Miciah Dashiel Butler Masters
parent a66f6f8c90
commit 92abd48405
9 changed files with 9 additions and 22 deletions

View File

@ -460,8 +460,6 @@ dialog_func(struct window *win, struct term_event *ev)
case EVENT_ABORT:
dialog_ev_abort(dlg_data);
break;
case EVENT_TEXTAREA:
break;
}
}

View File

@ -281,7 +281,6 @@ hierbox_dialog_event_handler(struct dialog_data *dlg_data)
case EVENT_RESIZE:
case EVENT_REDRAW:
case EVENT_MOUSE:
case EVENT_TEXTAREA:
return EVENT_NOT_PROCESSED;
case EVENT_ABORT:

View File

@ -729,7 +729,6 @@ kbd_listbox(struct dialog_data *dlg_data, struct widget_data *widget_data)
case EVENT_REDRAW:
case EVENT_MOUSE:
case EVENT_ABORT:
case EVENT_TEXTAREA:
break;
}

View File

@ -1006,8 +1006,6 @@ menu_handler(struct window *win, struct term_event *ev)
case EVENT_ABORT:
free_menu_items(menu->items);
break;
case EVENT_TEXTAREA:
break;
}
}
@ -1345,7 +1343,6 @@ mainmenu_handler(struct window *win, struct term_event *ev)
break;
case EVENT_ABORT:
case EVENT_TEXTAREA:
break;
}
}

View File

@ -1283,8 +1283,6 @@ tabwin_func(struct window *tab, struct term_event *ev)
assert(ses->tab == get_current_tab(ses->tab->term));
send_event(ses, ev);
break;
case EVENT_TEXTAREA:
break;
}
}

View File

@ -119,7 +119,6 @@ term_send_event(struct terminal *term, struct term_event *ev)
case EVENT_MOUSE:
case EVENT_KBD:
case EVENT_ABORT:
case EVENT_TEXTAREA:
assert(!list_empty(term->windows));
if_assert_failed break;
@ -273,6 +272,13 @@ handle_interlink_event(struct terminal *term, struct interlink_event *ilev)
ilev->info.size.width,
ilev->info.size.height);
term_send_event(term, &tev);
/* If textarea_data is set and the terminal is not blocked,
* then this resize event must be the result of exiting the
* external editor. */
if (term->textarea_data && term->blocked == -1)
textarea_edit(1, term, NULL, NULL, NULL);
break;
case EVENT_MOUSE:
@ -445,10 +451,6 @@ invalid_utf8_start_byte:
case EVENT_ABORT:
destroy_terminal(term);
return 0;
case EVENT_TEXTAREA:
if (term->textarea_data)
textarea_edit(1, term, NULL, NULL, NULL);
break;
default:
ERROR(gettext("Bad event %d"), ilev->ev);

View File

@ -20,7 +20,6 @@ enum term_event_type {
EVENT_REDRAW,
EVENT_RESIZE,
EVENT_ABORT,
EVENT_TEXTAREA,
};
/** An event received from a terminal. This type can be changed

View File

@ -352,16 +352,12 @@ handle_trm(int std_in, int std_out, int sock_in, int sock_out, int ctl_in,
static void
unblock_itrm_x(void *h)
{
struct interlink_event ev;
close_handle(h);
if (!ditrm) return;
unblock_itrm();
resize_terminal();
memset(&ev, 0, sizeof(ev));
ev.ev = EVENT_TEXTAREA;
itrm_queue_event(ditrm, (char *) &ev, sizeof(ev));
/* Note: External editor support depends on this resize event. */
resize_terminal();
}

View File

@ -152,7 +152,6 @@ empty_window_handler(struct window *win, struct term_event *ev)
return;
case EVENT_KBD:
case EVENT_MOUSE:
case EVENT_TEXTAREA:
/* Silence compiler warnings */
break;
}