From 533b1743c50f01d64c67cb69ccd0d8c6f9762092 Mon Sep 17 00:00:00 2001 From: jacob Date: Sun, 17 Oct 2004 14:44:27 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@4649 cda61777-01e9-0310-a592-d414129be87e --- putty.h | 4 ++++ telnet.c | 5 +++++ unix/pterm.c | 3 ++- window.c | 4 +--- 4 files changed, 12 insertions(+), 4 deletions(-) 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. -- 2.11.0