From c52dd4c99d7b1980746fb257325f502a593d60a8 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 27 Nov 2004 19:41:24 +0000 Subject: [PATCH] Changes in startup order to ensure any subsystem which might attempt to schedule timers is not started until after hwnd is initialised. git-svn-id: svn://svn.tartarus.org/sgt/putty@4912 cda61777-01e9-0310-a592-d414129be87e --- windows/window.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/windows/window.c b/windows/window.c index 6b7fc17a..4d581d70 100644 --- a/windows/window.c +++ b/windows/window.c @@ -588,10 +588,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) memset(&ucsdata, 0, sizeof(ucsdata)); - term = term_init(&cfg, &ucsdata, NULL); - logctx = log_init(NULL, &cfg); - term_provide_logctx(term, logctx); - cfgtopalette(); /* @@ -605,9 +601,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) font_height = 20; extra_width = 25; extra_height = 28; - term_size(term, cfg.height, cfg.width, cfg.savelines); - guess_width = extra_width + font_width * term->cols; - guess_height = extra_height + font_height * term->rows; + guess_width = extra_width + font_width * cfg.width; + guess_height = extra_height + font_height * cfg.height; { RECT r; get_fullscreen_rect(&r); @@ -635,6 +630,17 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } /* + * Initialise the terminal. (We have to do this _after_ + * creating the window, since the terminal is the first thing + * which will call schedule_timer(), which will in turn call + * timer_change_notify() which will expect hwnd to exist. + */ + term = term_init(&cfg, &ucsdata, NULL); + logctx = log_init(NULL, &cfg); + term_provide_logctx(term, logctx); + term_size(term, cfg.height, cfg.width, cfg.savelines); + + /* * Initialise the fonts, simultaneously correcting the guesses * for font_{width,height}. */ -- 2.11.0