Serial back end for Unix. Due to hardware limitations (no Linux box
[u/mdw/putty] / unix / gtkwin.c
index cb58216..920d7fe 100644 (file)
@@ -155,6 +155,8 @@ Filename platform_default_filename(const char *name)
 
 char *platform_default_s(const char *name)
 {
+    if (!strcmp(name, "SerialLine"))
+       return dupstr("/dev/ttyS0");
     return NULL;
 }
 
@@ -1392,8 +1394,13 @@ void palette_set(void *frontend, int n, int r, int g, int b)
     if (n > NALLCOLOURS)
        return;
     real_palette_set(inst, n, r, g, b);
-    if (n == 258)
+    if (n == 258) {
+       /* Default Background changed. Ensure space between text area and
+        * window border is redrawn */
        set_window_background(inst);
+       draw_backing_rect(inst);
+       gtk_widget_queue_draw(inst->area);
+    }
 }
 
 void palette_reset(void *frontend)
@@ -1445,7 +1452,13 @@ void palette_reset(void *frontend)
                     inst->cfg.colours[i][1], inst->cfg.colours[i][2]);
     }
 
+    /* Since Default Background may have changed, ensure that space
+     * between text area and window border is refreshed. */
     set_window_background(inst);
+    if (inst->area) {
+       draw_backing_rect(inst);
+       gtk_widget_queue_draw(inst->area);
+    }
 }
 
 /* Ensure that all the cut buffers exist - according to the ICCCM, we must
@@ -3375,6 +3388,8 @@ static void start_backend(struct gui_data *inst)
        set_icon(inst, title);
        sfree(title);
     }
+    sfree(realhost);
+
     inst->back->provide_logctx(inst->backhandle, inst->logctx);
 
     term_provide_resize_fn(inst->term, inst->back->size, inst->backhandle);
@@ -3431,7 +3446,7 @@ int pt_main(int argc, char **argv)
 
        cmdline_run_saved(&inst->cfg);
 
-       if (!*inst->cfg.host && !cfgbox(&inst->cfg))
+       if (!cfg_launchable(&inst->cfg) && !cfgbox(&inst->cfg))
            exit(0);                   /* config box hit Cancel */
     }