From 11c7c7608c5199a914d11f9f5d830e83041946f8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 15 Dec 2024 14:25:23 +0000 Subject: [PATCH] Remove bit-rotted RDB_DEBUG_PATCH. I was about to try to debug a window resizing issue, and it looked as if this patch had a plausible set of diagnostics already. But in fact when I turned on this #ifdef it failed to compile, so I'm getting rid of it. Perhaps there is a use for having types of diagnostic living permanently in the source code and easy to enable in themed sets, but if so, I think they'd be better compiled in and enabled by an option, than compiled out and enabled by #ifdef. That way they're less likely to rot, and also, you can ask a user to turn one on really easily and get extra logs for whatever is bothering them! --- windows/window.c | 54 ------------------------------------------------ 1 file changed, 54 deletions(-) diff --git a/windows/window.c b/windows/window.c index dbe565c7..e580f653 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1504,11 +1504,6 @@ static void init_fonts(WinGuiSeat *wgs, int pick_width, int pick_height) wgs->font_width = get_font_width(wgs, hdc, &tm); } -#ifdef RDB_DEBUG_PATCH - debug("Primary font H=%d, AW=%d, MW=%d\n", - tm.tmHeight, tm.tmAveCharWidth, tm.tmMaxCharWidth); -#endif - { CHARSETINFO info; DWORD cset = tm.tmCharSet; @@ -1795,10 +1790,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) int win_width, win_height, resize_action, window_border; RECT cr, wr; -#ifdef RDB_DEBUG_PATCH - debug("reset_window()\n"); -#endif - /* Current window sizes ... */ GetWindowRect(wgs->term_hwnd, &wr); GetClientRect(wgs->term_hwnd, &cr); @@ -1814,9 +1805,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) /* Are we being forced to reload the fonts ? */ if (reinit>1) { -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -- Forced deinit\n"); -#endif deinit_fonts(wgs); init_fonts(wgs, 0, 0); } @@ -1828,9 +1816,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) /* Is the window out of position ? */ if (!reinit) { recompute_window_offset(wgs); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> Reposition terminal\n"); -#endif } if (IsZoomed(wgs->term_hwnd)) { @@ -1857,10 +1842,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) wgs->offset_height = (win_height - wgs->font_height*wgs->term->rows) / 2; InvalidateRect(wgs->term_hwnd, NULL, true); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> Z font resize to (%d, %d)\n", - wgs->font_width, wgs->font_height); -#endif } } else { if (wgs->font_width * wgs->term->cols != win_width || @@ -1877,9 +1858,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) wgs->offset_height = (win_height - window_border - wgs->font_height*wgs->term->rows) / 2; InvalidateRect(wgs->term_hwnd, NULL, true); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> Zoomed term_size\n"); -#endif } } return; @@ -1921,10 +1899,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) * so we resize to the default font size. */ if (reinit>0) { -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> Forced re-init\n"); -#endif - wgs->offset_width = wgs->offset_height = window_border; wgs->extra_width = wr.right - wr.left - cr.right + cr.left + wgs->offset_width*2; @@ -2001,10 +1975,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) if ( width > wgs->term->cols ) width = wgs->term->cols; term_size(wgs->term, height, width, conf_get_int(wgs->conf, CONF_savelines)); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> term resize to (%d,%d)\n", - height, width); -#endif } } @@ -2014,11 +1984,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) SWP_NOMOVE | SWP_NOZORDER); InvalidateRect(wgs->term_hwnd, NULL, true); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> window resize to (%d,%d)\n", - wgs->font_width*term->cols + wgs->extra_width, - wgs->font_height*term->rows + wgs->extra_height); -#endif } return; } @@ -2040,10 +2005,6 @@ static void reset_window(WinGuiSeat *wgs, int reinit) wr.bottom - wr.top - cr.bottom + cr.top + wgs->offset_height*2; InvalidateRect(wgs->term_hwnd, NULL, true); -#ifdef RDB_DEBUG_PATCH - debug("reset_window() -> font resize to (%d,%d)\n", - wgs->font_width, wgs->font_height); -#endif } } @@ -2938,9 +2899,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, term_update(wgs->term); break; case WM_ENTERSIZEMOVE: -#ifdef RDB_DEBUG_PATCH - debug("WM_ENTERSIZEMOVE\n"); -#endif EnableSizeTip(true); wgs->resizing = true; wgs->need_backend_resize = false; @@ -2948,9 +2906,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, case WM_EXITSIZEMOVE: EnableSizeTip(false); wgs->resizing = false; -#ifdef RDB_DEBUG_PATCH - debug("WM_EXITSIZEMOVE\n"); -#endif if (wgs->need_backend_resize) { term_size(wgs->term, conf_get_int(wgs->conf, CONF_height), conf_get_int(wgs->conf, CONF_width), @@ -3063,15 +3018,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, break; case WM_SIZE: resize_action = conf_get_int(wgs->conf, CONF_resize_action); -#ifdef RDB_DEBUG_PATCH - debug("WM_SIZE %s (%d,%d)\n", - (wParam == SIZE_MINIMIZED) ? "SIZE_MINIMIZED": - (wParam == SIZE_MAXIMIZED) ? "SIZE_MAXIMIZED": - (wParam == SIZE_RESTORED && resizing) ? "to": - (wParam == SIZE_RESTORED) ? "SIZE_RESTORED": - "...", - LOWORD(lParam), HIWORD(lParam)); -#endif term_notify_minimised(wgs->term, wParam == SIZE_MINIMIZED); { /*