default_protocol = DEFAULT_PROTOCOL;
default_port = DEFAULT_PORT;
+ cfg.logtype = LGTYP_NONE;
do_defaults(NULL, &cfg);
tolower(p[2]) == 'h') {
default_protocol = cfg.protocol = PROT_SSH;
default_port = cfg.port = 22;
- } else if (q == p + 3 &&
- tolower(p[0]) == 'l' &&
- tolower(p[1]) == 'o' &&
- tolower(p[2]) == 'g') {
- logfile = "putty.log";
} else if (q == p + 7 &&
tolower(p[0]) == 'c' &&
tolower(p[1]) == 'l' &&
caretbm = CreateBitmap(font_width, font_height, 1, 1, bits);
sfree(bits);
}
+ CreateCaret(hwnd, caretbm, font_width, font_height);
/*
* Initialise the scroll bar.
ShowWindow (hwnd, show);
/*
+ * Open the initial log file if there is one.
+ */
+ logfopen();
+
+ /*
* Set the palette up.
*/
pal = NULL;
static int ignore_clip = FALSE;
static int just_reconfigged = FALSE;
static int resizing = FALSE;
+ static int need_backend_resize = FALSE;
switch (message) {
case WM_TIMER:
case IDM_RECONF:
{
int prev_alwaysontop = cfg.alwaysontop;
+ char oldlogfile[FILENAME_MAX];
+ int oldlogtype;
int need_setwpos = FALSE;
+ int old_fwidth, old_fheight;
+
+ strcpy(oldlogfile, cfg.logfilename);
+ oldlogtype = cfg.logtype;
cfg.width = cols;
cfg.height = rows;
+ old_fwidth = font_width;
+ old_fheight = font_height;
+
if (!do_reconfig(hwnd))
break;
+
+ if (strcmp(oldlogfile, cfg.logfilename) ||
+ oldlogtype != cfg.logtype) {
+ logfclose(); /* reset logging */
+ logfopen();
+ }
+
just_reconfigged = TRUE;
{
int i;
if (cfg.height != rows ||
cfg.width != cols ||
+ old_fwidth != font_width ||
+ old_fheight != font_height ||
cfg.savelines != savelines)
need_setwpos = TRUE;
term_size(cfg.height, cfg.width, cfg.savelines);
return 0;
case WM_SETFOCUS:
has_focus = TRUE;
- CreateCaret(hwnd, caretbm, 0, 0);
+ CreateCaret(hwnd, caretbm, font_width, font_height);
ShowCaret(hwnd);
compose_state = 0;
term_out();
case WM_ENTERSIZEMOVE:
EnableSizeTip(1);
resizing = TRUE;
+ need_backend_resize = FALSE;
break;
case WM_EXITSIZEMOVE:
EnableSizeTip(0);
resizing = FALSE;
- back->size();
+ if (need_backend_resize)
+ back->size();
break;
case WM_SIZING:
{
*/
if (!resizing)
back->size();
+ else
+ need_backend_resize = TRUE;
just_reconfigged = FALSE;
}
}