From 866f8e2d96743b5a5fc57af64295e53c8a1e59e6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 2 Feb 2020 10:00:42 +0000 Subject: [PATCH] Move the global 'logbox' into windlg.c. It was only used in one place outside that module, so I've provided an accessor for that one case. --- windows/windlg.c | 3 +++ windows/window.c | 1 + windows/winstuff.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/windows/windlg.c b/windows/windlg.c index 183837db..d2704520 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -78,6 +78,9 @@ static char *getevent(int i) return NULL; } +static HWND logbox; +HWND event_log_window(void) { return logbox; } + static INT_PTR CALLBACK LogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { diff --git a/windows/window.c b/windows/window.c index 6af2359e..59259703 100644 --- a/windows/window.c +++ b/windows/window.c @@ -939,6 +939,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) if (msg.message == WM_QUIT) goto finished; /* two-level break */ + HWND logbox = event_log_window(); if (!(IsWindow(logbox) && IsDialogMessage(logbox, &msg))) DispatchMessageW(&msg); diff --git a/windows/winstuff.h b/windows/winstuff.h index 1e379755..25afd554 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -211,7 +211,6 @@ typedef void *Ssh_gss_name; * PuTTY session. */ GLOBAL HWND hwnd; /* the main terminal window */ -GLOBAL HWND logbox; /* * The all-important instance handle. @@ -577,6 +576,7 @@ void showabout(HWND); void force_normal(HWND hwnd); void modal_about_box(HWND hwnd); void show_help(HWND hwnd); +HWND event_log_window(void); /* * Exports from winmisc.c.