From ef454cf704fdf8862f9f75e20fa989a1564e4be9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 28 Mar 2013 11:18:16 +0200 Subject: [PATCH] Add debugging code to w32fns.c. src/w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help identify the reasons for assertion violations in bug#14062 and similar ones. --- src/ChangeLog | 4 ++++ src/w32fns.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index d4edb2c3267..1e47fa0e1b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2013-03-28 Eli Zaretskii + * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help + identify the reasons for assertion violations in bug#14062 and + similar ones. + * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN. Reported by . diff --git a/src/w32fns.c b/src/w32fns.c index 88141893445..02cc2a00338 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3155,8 +3155,26 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) form.ptCurrentPos.y = w32_system_caret_y; form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0); + +#ifdef ENABLE_CHECKING + /* Temporary code to catch crashes in computing form.rcArea.top. */ + { + int wmbp = WINDOW_MENU_BAR_P (w); + int wtbp = WINDOW_TOOL_BAR_P (w); + struct frame *wf = WINDOW_XFRAME (w); + int fibw = FRAME_INTERNAL_BORDER_WIDTH (wf); + int wtel = WINDOW_TOP_EDGE_LINE (w); + int wflh = FRAME_LINE_HEIGHT (wf); + int wwhlp= WINDOW_WANTS_HEADER_LINE_P (w); + int chlh = CURRENT_HEADER_LINE_HEIGHT (w); + int whlh = (wwhlp ? chlh : 0); + + form.rcArea.top = ((wmbp || wtbp) ? 0 : fibw) + wtel * wflh + whlh; + } +#else form.rcArea.top = (WINDOW_TOP_EDGE_Y (w) + WINDOW_HEADER_LINE_HEIGHT (w)); +#endif form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w) - WINDOW_RIGHT_MARGIN_WIDTH (w) - WINDOW_RIGHT_FRINGE_WIDTH (w)); -- 2.39.2