Another attempt to solve bug #14062 with assertion violations on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Tue, 14 May 2013 14:09:43 +0000 (17:09 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 14 May 2013 14:09:43 +0000 (17:09 +0300)
 src/w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
 unless we know that the window w is a leaf window.  Another
 attempt at solving bug#14062.

src/ChangeLog
src/w32fns.c

index db766c7..d7778e3 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-14  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
+       unless we know that the window w is a leaf window.  Another
+       attempt at solving bug#14062.
+
 2013-05-14  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
index 6658134..d7ac0dd 100644 (file)
@@ -3183,8 +3183,9 @@ 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);
-         form.rcArea.top = (WINDOW_TOP_EDGE_Y (w)
-                            + WINDOW_HEADER_LINE_HEIGHT (w));
+         form.rcArea.top = WINDOW_TOP_EDGE_Y (w);
+         if (BUFFERP (w->contents))
+           form.rcArea.top += WINDOW_HEADER_LINE_HEIGHT (w);
          form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w)
                               - WINDOW_RIGHT_MARGIN_WIDTH (w)
                               - WINDOW_RIGHT_FRINGE_WIDTH (w));