Telnet specials menu was not being reinstated after a session was restarted in
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Sun, 17 Oct 2004 14:44:27 +0000 (14:44 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Sun, 17 Oct 2004 14:44:27 +0000 (14:44 +0000)
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
telnet.c
unix/pterm.c
window.c

diff --git a/putty.h b/putty.h
index a7f3f5b..e5cce12 100644 (file)
--- 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
index 5b34048..540c6d2 100644 (file)
--- 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;
 }
 
index 13cd994..da1bc8d 100644 (file)
@@ -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);
index 9b053da..b2ff8af 100644 (file)
--- 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.