From: Jacob Nevins Date: Sun, 17 Oct 2004 14:44:27 +0000 (+0000) Subject: Telnet specials menu was not being reinstated after a session was restarted in X-Git-Tag: 0.58~414 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=4482a79162140b650ffde9aeac5bef2d7e3f86ed;p=PuTTY.git Telnet specials menu was not being reinstated after a session was restarted in the same window (Windows version only). Policy change: it's now the backend's responsibility to call update_specials_menu() at the start of a session (or whenever it feels ready), if it has any special commands. Otherwise the menu won't be displayed. [originally from svn r4649] --- diff --git a/putty.h b/putty.h index a7f3f5b2..e5cce125 100644 --- a/putty.h +++ b/putty.h @@ -561,6 +561,10 @@ void sys_cursor(void *frontend, int x, int y); void request_paste(void *frontend); void frontend_keypress(void *frontend); void ldisc_update(void *frontend, int echo, int edit); +/* It's the backend's responsibility to invoke this at the start of a + * connection, if necessary; it can also invoke it later if the set of + * special commands changes. It does not need to invoke it at session + * shutdown. */ void update_specials_menu(void *frontend); int from_backend(void *frontend, int is_stderr, const char *data, int len); #define OPTIMISE_IS_SCROLL 1 diff --git a/telnet.c b/telnet.c index 5b340488..540c6d2c 100644 --- a/telnet.c +++ b/telnet.c @@ -762,6 +762,11 @@ static const char *telnet_init(void *frontend_handle, void **backend_handle, */ telnet->in_synch = FALSE; + /* + * We can send special commands from the start. + */ + update_specials_menu(telnet->frontend); + return NULL; } diff --git a/unix/pterm.c b/unix/pterm.c index 13cd994f..da1bc8d5 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -3217,7 +3217,6 @@ static void start_backend(struct gui_data *inst) sfree(title); } inst->back->provide_logctx(inst->backhandle, inst->logctx); - update_specials_menu(inst); term_provide_resize_fn(inst->term, inst->back->size, inst->backhandle); @@ -3436,6 +3435,8 @@ int pt_main(int argc, char **argv) inst->specialsitem1 = menuitem; MKMENUITEM(NULL, NULL); inst->specialsitem2 = menuitem; + gtk_widget_hide(inst->specialsitem1); + gtk_widget_hide(inst->specialsitem2); MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem); MKMENUITEM("Reset Terminal", reset_terminal_menuitem); MKMENUITEM("Copy All", copy_all_menuitem); diff --git a/window.c b/window.c index 9b053dae..b2ff8af3 100644 --- a/window.c +++ b/window.c @@ -686,8 +686,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) SetScrollInfo(hwnd, SB_VERT, &si, FALSE); } - start_backend(); - /* * Prepare the mouse handler. */ @@ -742,7 +740,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } } - update_specials_menu(NULL); + start_backend(); /* * Set up the initial input locale.