diff --git a/src/bfu/dialog.c b/src/bfu/dialog.c index 865415a97..f99e78145 100644 --- a/src/bfu/dialog.c +++ b/src/bfu/dialog.c @@ -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; } } diff --git a/src/bfu/hierbox.c b/src/bfu/hierbox.c index 6cbaaa61e..5d49e64e5 100644 --- a/src/bfu/hierbox.c +++ b/src/bfu/hierbox.c @@ -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: diff --git a/src/bfu/listbox.c b/src/bfu/listbox.c index 8d54858c5..2e27abae9 100644 --- a/src/bfu/listbox.c +++ b/src/bfu/listbox.c @@ -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; } diff --git a/src/bfu/menu.c b/src/bfu/menu.c index d45854cf4..f4501017c 100644 --- a/src/bfu/menu.c +++ b/src/bfu/menu.c @@ -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; } } diff --git a/src/session/session.c b/src/session/session.c index 149cdca2f..cdb44aa14 100644 --- a/src/session/session.c +++ b/src/session/session.c @@ -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; } } diff --git a/src/terminal/event.c b/src/terminal/event.c index a3af89ddd..16f2f0cc7 100644 --- a/src/terminal/event.c +++ b/src/terminal/event.c @@ -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); diff --git a/src/terminal/event.h b/src/terminal/event.h index a2324debe..9de3ce1e2 100644 --- a/src/terminal/event.h +++ b/src/terminal/event.h @@ -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 diff --git a/src/terminal/kbd.c b/src/terminal/kbd.c index 7d82af229..1d3423237 100644 --- a/src/terminal/kbd.c +++ b/src/terminal/kbd.c @@ -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(); } diff --git a/src/terminal/window.c b/src/terminal/window.c index 4e96f2d0c..d4cd6c1b9 100644 --- a/src/terminal/window.c +++ b/src/terminal/window.c @@ -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; }