aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2014-01-11 22:00:54 +0900
committerKenichi Handa2014-01-11 22:00:54 +0900
commitaf05bef2d1985fb9bd8485f3084f3bfe282a911f (patch)
tree073c53ac52592c200d8b00e5458d4dc70c8647f4 /src
parent3923e7bde942018135c7362c75327ffddcbd81fc (diff)
parent02013850f638520bed0d6c3f77eb9c80e0f73983 (diff)
downloademacs-af05bef2d1985fb9bd8485f3084f3bfe282a911f.tar.gz
emacs-af05bef2d1985fb9bd8485f3084f3bfe282a911f.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog56
-rw-r--r--src/ChangeLog.122
-rw-r--r--src/ChangeLog.34
-rw-r--r--src/dispnew.c9
-rw-r--r--src/font.c2
-rw-r--r--src/frame.c13
-rw-r--r--src/w32fns.c17
-rw-r--r--src/window.c3
-rw-r--r--src/xdisp.c21
-rw-r--r--src/xfns.c7
-rw-r--r--src/xterm.c76
-rw-r--r--src/xterm.h4
12 files changed, 157 insertions, 57 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8df6e31521d..556fcce5fa5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,37 @@
12014-01-11 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (try_window_id): Don't use this function's optimizations
4 if overlays in the buffer displayed by the window have changed
5 since last redisplay. (Bug#16347)
6 (message_dolog): Fix indentation.
7
82014-01-11 Martin Rudalics <rudalics@gmx.at>
9
10 * frame.c (frame_resize_pixelwise): Fix doc-string.
11
122014-01-10 Martin Rudalics <rudalics@gmx.at>
13
14 Fix handling of internal borders (Bug#16348).
15 * dispnew.c (adjust_frame_glyphs_for_window_redisplay): Remove
16 internal border width from pixel width of windows.
17 (change_frame_size_1): Don't return early when frame's pixel
18 size changes - we still have to record the new sizes in the
19 frame structure.
20 * w32fns.c (x_set_tool_bar_lines): Clear internal border width
21 also when toolbar gets larger.
22 * window.c (check_frame_size): Include internal_border_width in
23 check.
24 * xdisp.c (Ftool_bar_height): Fix doc-string typo.
25 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): In
26 non-toolkit/non-GTK version clear internal border.
27 * xterm.c (x_clear_under_internal_border): New function for
28 non-toolkit/non-GTK version.
29 (x_after_update_window_line): In non-toolkit/non-GTK version
30 don't do that.
31 (handle_one_xevent, x_set_window_size): Call
32 x_clear_under_internal_border in non-toolkit/non-GTK version.
33 * xterm.h (x_clear_under_internal_border): Extern it.
34
12014-01-07 Paul Eggert <eggert@cs.ucla.edu> 352014-01-07 Paul Eggert <eggert@cs.ucla.edu>
2 36
3 Fix misdisplay of interlaced GIFs with libgif5 (Bug#16372). 37 Fix misdisplay of interlaced GIFs with libgif5 (Bug#16372).
@@ -654,7 +688,7 @@
654 * conf_post.h: Include <stdbool.h>. 688 * conf_post.h: Include <stdbool.h>.
655 (bool_bf): New type. 689 (bool_bf): New type.
656 * dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY): 690 * dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
657 * interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE) 691 * intervals.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
658 Surround statement macro with proper 'do { ... } while (false)' brackets. 692 Surround statement macro with proper 'do { ... } while (false)' brackets.
659 * dispextern.h (IF_DEBUG): Properly parenthesize and convert to void. 693 * dispextern.h (IF_DEBUG): Properly parenthesize and convert to void.
660 Args must now be expressions; all callers changed. 694 Args must now be expressions; all callers changed.
@@ -3447,7 +3481,7 @@
3447 (Qbool_vector_p): Declare. 3481 (Qbool_vector_p): Declare.
3448 (CHECK_BOOL_VECTOR, ROUNDUP, BITS_PER_SIZE_T): New macros. 3482 (CHECK_BOOL_VECTOR, ROUNDUP, BITS_PER_SIZE_T): New macros.
3449 (swap16, swap32, swap64): New inline functions. 3483 (swap16, swap32, swap64): New inline functions.
3450 * macfont.c (macfont_shape): Change lint_assume to assume. 3484 * macfont.m (macfont_shape): Change lint_assume to assume.
3451 * ralloc.c: Rename ROUNDUP to PAGE_ROUNDUP throughout. 3485 * ralloc.c: Rename ROUNDUP to PAGE_ROUNDUP throughout.
3452 * xsettings.c (parse_settings): Use new swap16 and 3486 * xsettings.c (parse_settings): Use new swap16 and
3453 swap32 from lisp.h instead of file-specific macros. 3487 swap32 from lisp.h instead of file-specific macros.
@@ -3511,7 +3545,7 @@
3511 * process.h, process.c (PROCESS_INLINE): 3545 * process.h, process.c (PROCESS_INLINE):
3512 * syntax.h, syntax.c (SYNTAX_INLINE): 3546 * syntax.h, syntax.c (SYNTAX_INLINE):
3513 * systime.h, sysdep.c (SYSTIME_INLINE): 3547 * systime.h, sysdep.c (SYSTIME_INLINE):
3514 * termhooks.h, terminal.h (TERMHOOKS_INLINE): 3548 * termhooks.h, terminal.c (TERMHOOKS_INLINE):
3515 * window.h, window.c (WINDOW_INLINE): 3549 * window.h, window.c (WINDOW_INLINE):
3516 Remove. All uses replaced with INLINE. 3550 Remove. All uses replaced with INLINE.
3517 3551
@@ -3718,7 +3752,7 @@
3718 (x_handle_dnd_message): 3752 (x_handle_dnd_message):
3719 * xsettings.c (xft_settings_event): 3753 * xsettings.c (xft_settings_event):
3720 Use 'const XEvent * const' where appropriate. 3754 Use 'const XEvent * const' where appropriate.
3721 * xterm.h, gtkutil.h, xsettngs.h: Adjust related prototypes. 3755 * xterm.h, gtkutil.h, xsettings.h: Adjust related prototypes.
3722 3756
37232013-09-16 Dmitry Antipov <dmantipov@yandex.ru> 37572013-09-16 Dmitry Antipov <dmantipov@yandex.ru>
3724 3758
@@ -3760,7 +3794,7 @@
3760 (Fx_create_frame): Register macfont driver, make a better default font. 3794 (Fx_create_frame): Register macfont driver, make a better default font.
3761 (Fns_popup_font_panel): Get font from macfont driver, if used. 3795 (Fns_popup_font_panel): Get font from macfont driver, if used.
3762 3796
3763 * macfont.m, macfont.h, maccuvs.h: New files. 3797 * macfont.m, macfont.h, macuvs.h: New files.
3764 3798
3765 * font.h: Declare syms_of_macfont. 3799 * font.h: Declare syms_of_macfont.
3766 3800
@@ -6065,7 +6099,7 @@
6065 New unwind-protect flavors to better type-check C callbacks. 6099 New unwind-protect flavors to better type-check C callbacks.
6066 This also lessens the need to write wrappers for callbacks, 6100 This also lessens the need to write wrappers for callbacks,
6067 and the need for make_save_pointer. 6101 and the need for make_save_pointer.
6068 * alloca.c (free_save_value): 6102 * alloc.c (free_save_value):
6069 * atimer.c (run_all_atimers): 6103 * atimer.c (run_all_atimers):
6070 Now extern. 6104 Now extern.
6071 * alloc.c (safe_alloca_unwind): 6105 * alloc.c (safe_alloca_unwind):
@@ -6074,13 +6108,13 @@
6074 * menu.c (cleanup_popup_menu) [HAVE_NS]: 6108 * menu.c (cleanup_popup_menu) [HAVE_NS]:
6075 * minibuf.c (choose_minibuf_frame_1): 6109 * minibuf.c (choose_minibuf_frame_1):
6076 * process.c (make_serial_process_unwind): 6110 * process.c (make_serial_process_unwind):
6077 * xdisp.h (pop_message_unwind): 6111 * xdisp.c (pop_message_unwind):
6078 * xselect.c (queue_selection_requests_unwind): 6112 * xselect.c (queue_selection_requests_unwind):
6079 Remove no-longer-needed wrapper. All uses replaced by the wrappee. 6113 Remove no-longer-needed wrapper. All uses replaced by the wrappee.
6080 * alloca.c (record_xmalloc): 6114 * alloc.c (record_xmalloc):
6081 Prefer record_unwind_protect_ptr to record_unwind_protect with 6115 Prefer record_unwind_protect_ptr to record_unwind_protect with
6082 make_save_pointer. 6116 make_save_pointer.
6083 * alloca.c (Fgarbage_collect): 6117 * alloc.c (Fgarbage_collect):
6084 Prefer record_unwind_protect_void to passing a dummy. 6118 Prefer record_unwind_protect_void to passing a dummy.
6085 * buffer.c (restore_buffer): 6119 * buffer.c (restore_buffer):
6086 * window.c (restore_window_configuration): 6120 * window.c (restore_window_configuration):
@@ -6686,8 +6720,8 @@
6686 Use emacs_open more consistently when opening files. 6720 Use emacs_open more consistently when opening files.
6687 This handles EINTR more consistently now, and makes it easier 6721 This handles EINTR more consistently now, and makes it easier
6688 to introduce other uniform changes to file descriptor handling. 6722 to introduce other uniform changes to file descriptor handling.
6689 * src/systdio.h: New file. 6723 * sysstdio.h: New file.
6690 * src/buffer.c (mmap_init): 6724 * buffer.c (mmap_init):
6691 * cygw32.c (chdir_to_default_directory): 6725 * cygw32.c (chdir_to_default_directory):
6692 * dispnew.c (Fopen_termscript): 6726 * dispnew.c (Fopen_termscript):
6693 * emacs.c (Fdaemon_initialized): 6727 * emacs.c (Fdaemon_initialized):
diff --git a/src/ChangeLog.12 b/src/ChangeLog.12
index 07aedadccae..a9a1d9b1326 100644
--- a/src/ChangeLog.12
+++ b/src/ChangeLog.12
@@ -2400,7 +2400,7 @@
2400 * w32term.h (x_char_width, x_char_height): Likewise. 2400 * w32term.h (x_char_width, x_char_height): Likewise.
2401 * xfns.c (x_char_width, x_char_height): Remove. 2401 * xfns.c (x_char_width, x_char_height): Remove.
2402 * w32fns.c (x_char_width, x_char_height): Likewise. 2402 * w32fns.c (x_char_width, x_char_height): Likewise.
2403 * nsfns.c (x_char_width, x_char_height): Likewise. 2403 * nsfns.m (x_char_width, x_char_height): Likewise.
2404 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for 2404 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2405 all window frames. 2405 all window frames.
2406 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT. 2406 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
diff --git a/src/ChangeLog.3 b/src/ChangeLog.3
index 1a2763f8ff8..cee5d43ed57 100644
--- a/src/ChangeLog.3
+++ b/src/ChangeLog.3
@@ -15138,8 +15138,8 @@
15138 15138
151391989-06-23 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu) 151391989-06-23 Joseph Arceneaux (jla@apple-gunkies.ai.mit.edu)
15140 15140
15141 * xfns.c, lisp/term/x-win.el: C routine Fscreen_color_p now lisp 15141 * xfns.c: C routine Fscreen_color_p now lisp
15142 function x-color-screen-p in x-win.el. 15142 function x-color-screen-p in lisp/term/x-win.el.
15143 (x_set_cursor_color): New method: first disallow same cursor as 15143 (x_set_cursor_color): New method: first disallow same cursor as
15144 background, then if cursor not foreground, use it as cursor 15144 background, then if cursor not foreground, use it as cursor
15145 foreground. 15145 foreground.
diff --git a/src/dispnew.c b/src/dispnew.c
index c3cca33b187..e11d143d0b5 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -2055,7 +2055,8 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
2055 w->left_col = 0; 2055 w->left_col = 0;
2056 w->pixel_top = 0; 2056 w->pixel_top = 0;
2057 w->top_line = 0; 2057 w->top_line = 0;
2058 w->pixel_width = FRAME_PIXEL_WIDTH (f); 2058 w->pixel_width = (FRAME_PIXEL_WIDTH (f)
2059 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
2059 w->total_cols = FRAME_TOTAL_COLS (f); 2060 w->total_cols = FRAME_TOTAL_COLS (f);
2060 w->pixel_height = FRAME_MENU_BAR_HEIGHT (f); 2061 w->pixel_height = FRAME_MENU_BAR_HEIGHT (f);
2061 w->total_lines = FRAME_MENU_BAR_LINES (f); 2062 w->total_lines = FRAME_MENU_BAR_LINES (f);
@@ -5515,7 +5516,11 @@ change_frame_size_1 (struct frame *f, int new_width, int new_height,
5515 example, fullscreen and remove/add scroll bar. */ 5516 example, fullscreen and remove/add scroll bar. */
5516 if (new_text_height == FRAME_TEXT_HEIGHT (f) 5517 if (new_text_height == FRAME_TEXT_HEIGHT (f)
5517 && new_text_width == FRAME_TEXT_WIDTH (f) 5518 && new_text_width == FRAME_TEXT_WIDTH (f)
5518 && new_root_width == old_root_width) 5519 && new_root_width == old_root_width
5520 && (FRAME_PIXEL_HEIGHT (f) ==
5521 FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height))
5522 && (FRAME_PIXEL_WIDTH (f) ==
5523 FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width)))
5519 return; 5524 return;
5520 5525
5521 block_input (); 5526 block_input ();
diff --git a/src/font.c b/src/font.c
index cb0a28a524b..fa097c7d7e6 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4429,7 +4429,7 @@ where
4429 LANGSYS is a symbol specifying a langsys tag of OpenType, 4429 LANGSYS is a symbol specifying a langsys tag of OpenType,
4430 GSUB and GPOS, if non-nil, are lists of symbols specifying feature tags. 4430 GSUB and GPOS, if non-nil, are lists of symbols specifying feature tags.
4431 4431
4432If LANGYS is nil, the default langsys is selected. 4432If LANGSYS is nil, the default langsys is selected.
4433 4433
4434The features are applied in the order they appear in the list. The 4434The features are applied in the order they appear in the list. The
4435symbol `*' means to apply all available features not present in this 4435symbol `*' means to apply all available features not present in this
diff --git a/src/frame.c b/src/frame.c
index 76883820672..703c67a3b1e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4709,7 +4709,6 @@ or call the function `tool-bar-mode'. */);
4709 4709
4710 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, 4710 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
4711 doc: /* Minibufferless frames use this frame's minibuffer. 4711 doc: /* Minibufferless frames use this frame's minibuffer.
4712
4713Emacs cannot create minibufferless frames unless this is set to an 4712Emacs cannot create minibufferless frames unless this is set to an
4714appropriate surrogate. 4713appropriate surrogate.
4715 4714
@@ -4730,9 +4729,15 @@ automatically. See also `mouse-autoselect-window'. */);
4730 focus_follows_mouse = 0; 4729 focus_follows_mouse = 0;
4731 4730
4732 DEFVAR_BOOL ("frame-resize-pixelwise", frame_resize_pixelwise, 4731 DEFVAR_BOOL ("frame-resize-pixelwise", frame_resize_pixelwise,
4733 doc: /* Non-nil means frames are resized pixelwise. 4732 doc: /* Non-nil means resize frames pixelwise.
4734If this is nil, resizing a frame will round sizes to the frame's 4733If this option is nil, resizing a frame rounds its sizes to the frame's
4735current values of `frame-char-height' and `frame-char-width'. */); 4734current values of `frame-char-height' and `frame-char-width'. If this
4735is non-nil, no rounding occurs, hence frame sizes can increase/decrease
4736by one pixel.
4737
4738With some window managers you have to set this to non-nil in order to
4739fully maximize frames. The default of this option is nil. To resize
4740your initial frame pixelwise, set this option in your init file. */);
4736 frame_resize_pixelwise = 0; 4741 frame_resize_pixelwise = 0;
4737 4742
4738 staticpro (&Vframe_list); 4743 staticpro (&Vframe_list);
diff --git a/src/w32fns.c b/src/w32fns.c
index 03779be036c..d6f3fe7a3eb 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1713,26 +1713,23 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1713 /* If the tool bar gets smaller, the internal border below it 1713 /* If the tool bar gets smaller, the internal border below it
1714 has to be cleared. It was formerly part of the display 1714 has to be cleared. It was formerly part of the display
1715 of the larger tool bar, and updating windows won't clear it. */ 1715 of the larger tool bar, and updating windows won't clear it. */
1716 if (delta < 0) 1716 if (FRAME_INTERNAL_BORDER_WIDTH (f) != 0)
1717 { 1717 {
1718 int height = FRAME_INTERNAL_BORDER_WIDTH (f); 1718 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
1719 int width = FRAME_PIXEL_WIDTH (f); 1719 int width = FRAME_PIXEL_WIDTH (f);
1720 int y = nlines * unit; 1720 int y = nlines * unit;
1721 HDC hdc = get_frame_dc (f);
1721 1722
1722 block_input (); 1723 block_input ();
1723 { 1724 w32_clear_area (f, hdc, 0, y, width, height);
1724 HDC hdc = get_frame_dc (f); 1725 release_frame_dc (f, hdc);
1725 w32_clear_area (f, hdc, 0, y, width, height);
1726 release_frame_dc (f, hdc);
1727 }
1728 unblock_input (); 1726 unblock_input ();
1729
1730 if (WINDOWP (f->tool_bar_window))
1731 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
1732 } 1727 }
1733 1728
1734 run_window_configuration_change_hook (f); 1729 if (delta < 0 && WINDOWP (f->tool_bar_window))
1730 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
1735 1731
1732 run_window_configuration_change_hook (f);
1736} 1733}
1737 1734
1738 1735
diff --git a/src/window.c b/src/window.c
index f85627ac49f..bd319f5be8f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3155,6 +3155,7 @@ check_frame_size (struct frame *frame, int *width, int *height, bool pixelwise)
3155 min_height = 2 * min_height; 3155 min_height = 2 * min_height;
3156 3156
3157 min_height += FRAME_TOP_MARGIN_HEIGHT (frame); 3157 min_height += FRAME_TOP_MARGIN_HEIGHT (frame);
3158 min_height += FRAME_INTERNAL_BORDER_WIDTH (frame);
3158 3159
3159 if (*height < min_height) 3160 if (*height < min_height)
3160 *height = min_height; 3161 *height = min_height;
@@ -4047,6 +4048,8 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise)
4047 have implicitly given us a zero or negative height. */ 4048 have implicitly given us a zero or negative height. */
4048 if (pixelwise) 4049 if (pixelwise)
4049 { 4050 {
4051 /* Note: This does not include the size for internal borders
4052 since these are not part of the frame's text area. */
4050 new_pixel_size = max (horflag 4053 new_pixel_size = max (horflag
4051 ? size 4054 ? size
4052 : (size 4055 : (size
diff --git a/src/xdisp.c b/src/xdisp.c
index 404c8a61e52..8efe3492db0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9854,7 +9854,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
9854 incrementing windows_or_buffers_changed even if *Messages* is 9854 incrementing windows_or_buffers_changed even if *Messages* is
9855 shown in some window. So we must manually set 9855 shown in some window. So we must manually set
9856 windows_or_buffers_changed here to make up for that. */ 9856 windows_or_buffers_changed here to make up for that. */
9857 windows_or_buffers_changed = old_windows_or_buffers_changed; 9857 windows_or_buffers_changed = old_windows_or_buffers_changed;
9858 bset_redisplay (current_buffer); 9858 bset_redisplay (current_buffer);
9859 9859
9860 set_buffer_internal (oldbuf); 9860 set_buffer_internal (oldbuf);
@@ -12109,7 +12109,7 @@ DEFUN ("tool-bar-height", Ftool_bar_height, Stool_bar_height,
12109 0, 2, 0, 12109 0, 2, 0,
12110 doc: /* Return the number of lines occupied by the tool bar of FRAME. 12110 doc: /* Return the number of lines occupied by the tool bar of FRAME.
12111If FRAME is nil or omitted, use the selected frame. Optional argument 12111If FRAME is nil or omitted, use the selected frame. Optional argument
12112PIXELWISE non-nil means return the height of the tool bar inpixels. */) 12112PIXELWISE non-nil means return the height of the tool bar in pixels. */)
12113 (Lisp_Object frame, Lisp_Object pixelwise) 12113 (Lisp_Object frame, Lisp_Object pixelwise)
12114{ 12114{
12115 int height = 0; 12115 int height = 0;
@@ -17333,9 +17333,16 @@ row_containing_pos (struct window *w, ptrdiff_t charpos,
17333 17333
17334 Value is 17334 Value is
17335 17335
17336 1 if display has been updated 17336 >= 1 if successful, i.e. display has been updated
17337 0 if otherwise unsuccessful 17337 specifically:
17338 1 means the changes were in front of a newline that precedes
17339 the window start, and the whole current matrix was reused
17340 2 means the changes were after the last position displayed
17341 in the window, and the whole current matrix was reused
17342 3 means portions of the current matrix were reused, while
17343 some of the screen lines were redrawn
17338 -1 if redisplay with same window start is known not to succeed 17344 -1 if redisplay with same window start is known not to succeed
17345 0 if otherwise unsuccessful
17339 17346
17340 The following steps are performed: 17347 The following steps are performed:
17341 17348
@@ -17410,6 +17417,12 @@ try_window_id (struct window *w)
17410 if (windows_or_buffers_changed || f->cursor_type_changed) 17417 if (windows_or_buffers_changed || f->cursor_type_changed)
17411 GIVE_UP (2); 17418 GIVE_UP (2);
17412 17419
17420 /* This function's optimizations cannot be used if overlays have
17421 changed in the buffer displayed by the window, so give up if they
17422 have. */
17423 if (w->last_overlay_modified != OVERLAY_MODIFF)
17424 GIVE_UP (21);
17425
17413 /* Verify that narrowing has not changed. 17426 /* Verify that narrowing has not changed.
17414 Also verify that we were not told to prevent redisplay optimizations. 17427 Also verify that we were not told to prevent redisplay optimizations.
17415 It would be nice to further 17428 It would be nice to further
diff --git a/src/xfns.c b/src/xfns.c
index a78c2bf6b76..debc707dba2 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -998,6 +998,8 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
998 FRAME_MENU_BAR_LINES (f) = nlines; 998 FRAME_MENU_BAR_LINES (f) = nlines;
999 FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f); 999 FRAME_MENU_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
1000 resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1); 1000 resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
1001 if (FRAME_X_WINDOW (f))
1002 x_clear_under_internal_border (f);
1001 1003
1002 /* If the menu bar height gets changed, the internal border below 1004 /* If the menu bar height gets changed, the internal border below
1003 the top margin has to be cleared. Also, if the menu bar gets 1005 the top margin has to be cleared. Also, if the menu bar gets
@@ -1110,8 +1112,11 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1110 1112
1111 FRAME_TOOL_BAR_LINES (f) = nlines; 1113 FRAME_TOOL_BAR_LINES (f) = nlines;
1112 FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f); 1114 FRAME_TOOL_BAR_HEIGHT (f) = nlines * FRAME_LINE_HEIGHT (f);
1113 ++windows_or_buffers_changed;
1114 resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1); 1115 resize_frame_windows (f, FRAME_TEXT_HEIGHT (f), 0, 1);
1116#if !defined USE_X_TOOLKIT && !defined USE_GTK
1117 if (FRAME_X_WINDOW (f))
1118 x_clear_under_internal_border (f);
1119#endif
1115 adjust_frame_glyphs (f); 1120 adjust_frame_glyphs (f);
1116 1121
1117 /* We also have to make sure that the internal border at the top of 1122 /* We also have to make sure that the internal border at the top of
diff --git a/src/xterm.c b/src/xterm.c
index f47d73cf7ed..105aaed2972 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -593,6 +593,32 @@ XTframe_up_to_date (struct frame *f)
593} 593}
594 594
595 595
596/* Clear under internal border if any for non-toolkit builds. */
597
598
599#if !defined USE_X_TOOLKIT && !defined USE_GTK
600void
601x_clear_under_internal_border (struct frame *f)
602{
603 if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
604 {
605 Display *display = FRAME_X_DISPLAY (f);
606 Window window = FRAME_X_WINDOW (f);
607 int border = FRAME_INTERNAL_BORDER_WIDTH (f);
608 int width = FRAME_PIXEL_WIDTH (f);
609 int height = FRAME_PIXEL_HEIGHT (f);
610 int margin = FRAME_TOP_MARGIN_HEIGHT (f);
611
612 block_input ();
613 x_clear_area (display, window, 0, 0, border, height);
614 x_clear_area (display, window, 0, margin, width, border);
615 x_clear_area (display, window, width - border, 0, border, height);
616 x_clear_area (display, window, 0, height - border, width, border);
617 unblock_input ();
618 }
619}
620#endif
621
596/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay 622/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay
597 arrow bitmaps, or clear the fringes if no bitmaps are required 623 arrow bitmaps, or clear the fringes if no bitmaps are required
598 before DESIRED_ROW is made current. This function is called from 624 before DESIRED_ROW is made current. This function is called from
@@ -602,38 +628,42 @@ XTframe_up_to_date (struct frame *f)
602static void 628static void
603x_after_update_window_line (struct window *w, struct glyph_row *desired_row) 629x_after_update_window_line (struct window *w, struct glyph_row *desired_row)
604{ 630{
605 struct frame *f;
606 int width, height;
607
608 eassert (w); 631 eassert (w);
609 632
610 if (!desired_row->mode_line_p && !w->pseudo_window_p) 633 if (!desired_row->mode_line_p && !w->pseudo_window_p)
611 desired_row->redraw_fringe_bitmaps_p = 1; 634 desired_row->redraw_fringe_bitmaps_p = 1;
612 635
636#ifdef USE_X_TOOLKIT
613 /* When a window has disappeared, make sure that no rest of 637 /* When a window has disappeared, make sure that no rest of
614 full-width rows stays visible in the internal border. Could 638 full-width rows stays visible in the internal border. Could
615 check here if updated window is the leftmost/rightmost window, 639 check here if updated window is the leftmost/rightmost window,
616 but I guess it's not worth doing since vertically split windows 640 but I guess it's not worth doing since vertically split windows
617 are almost never used, internal border is rarely set, and the 641 are almost never used, internal border is rarely set, and the
618 overhead is very small. */ 642 overhead is very small. */
619 if (windows_or_buffers_changed 643 {
620 && desired_row->full_width_p 644 struct frame *f;
621 && (f = XFRAME (w->frame), 645 int width, height;
622 width = FRAME_INTERNAL_BORDER_WIDTH (f), 646
623 width != 0) 647 if (windows_or_buffers_changed
624 && (height = desired_row->visible_height, 648 && desired_row->full_width_p
625 height > 0)) 649 && (f = XFRAME (w->frame),
626 { 650 width = FRAME_INTERNAL_BORDER_WIDTH (f),
627 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); 651 width != 0)
652 && (height = desired_row->visible_height,
653 height > 0))
654 {
655 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
628 656
629 block_input (); 657 block_input ();
630 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 658 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
631 0, y, width, height); 659 0, y, width, height);
632 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 660 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
633 FRAME_PIXEL_WIDTH (f) - width, 661 FRAME_PIXEL_WIDTH (f) - width,
634 y, width, height); 662 y, width, height);
635 unblock_input (); 663 unblock_input ();
636 } 664 }
665 }
666#endif
637} 667}
638 668
639static void 669static void
@@ -6618,7 +6648,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6618 || event->xconfigure.height != FRAME_PIXEL_HEIGHT (f)) 6648 || event->xconfigure.height != FRAME_PIXEL_HEIGHT (f))
6619 { 6649 {
6620 change_frame_size (f, width, height, 0, 1, 0, 1); 6650 change_frame_size (f, width, height, 0, 1, 0, 1);
6621 SET_FRAME_GARBAGED (f); 6651 x_clear_under_internal_border (f);
6652 SET_FRAME_GARBAGED (f);
6622 cancel_mouse_face (f); 6653 cancel_mouse_face (f);
6623 } 6654 }
6624 6655
@@ -8635,6 +8666,9 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
8635#else /* not USE_GTK */ 8666#else /* not USE_GTK */
8636 8667
8637 x_set_window_size_1 (f, change_gravity, width, height, pixelwise); 8668 x_set_window_size_1 (f, change_gravity, width, height, pixelwise);
8669#if !defined USE_X_TOOLKIT
8670 x_clear_under_internal_border (f);
8671#endif
8638 8672
8639#endif /* not USE_GTK */ 8673#endif /* not USE_GTK */
8640 8674
diff --git a/src/xterm.h b/src/xterm.h
index 7278f990528..3e79d46702c 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1049,6 +1049,10 @@ extern void x_session_close (void);
1049 1049
1050extern Lisp_Object Qx_gtk_map_stock; 1050extern Lisp_Object Qx_gtk_map_stock;
1051 1051
1052#if !defined USE_X_TOOLKIT && !defined USE_GTK
1053extern void x_clear_under_internal_border (struct frame *f);
1054#endif
1055
1052/* Is the frame embedded into another application? */ 1056/* Is the frame embedded into another application? */
1053 1057
1054#define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0) 1058#define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0)