diff options
| author | Martin Rudalics | 2014-01-11 10:31:09 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-01-11 10:31:09 +0100 |
| commit | 7d7ccb8829db98eca38cd2bfb31132a7f1adc022 (patch) | |
| tree | a10aca13dd3d5c942f3eacf52942ef128433cb30 /src/xterm.c | |
| parent | bada50fc50d34e0e2ffd00fd64957cfb397c6eee (diff) | |
| download | emacs-7d7ccb8829db98eca38cd2bfb31132a7f1adc022.tar.gz emacs-7d7ccb8829db98eca38cd2bfb31132a7f1adc022.zip | |
Fix handling of internal borders (Bug#16348).
* dispnew.c (adjust_frame_glyphs_for_window_redisplay): Remove
internal border width from pixel width of windows.
(change_frame_size_1): Don't return early when frame's pixel
size changes - we still have to record the new sizes in the
frame structure.
* w32fns.c (x_set_tool_bar_lines): Clear internal border width
also when toolbar gets larger.
* window.c (check_frame_size): Include internal_border_width in
check.
* xdisp.c (Ftool_bar_height): Fix doc-string typo.
* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): In
non-toolkit/non-GTK version clear internal border.
* xterm.c (x_clear_under_internal_border): New function for
non-toolkit/non-GTK version.
(x_after_update_window_line): In non-toolkit/non-GTK version
don't do that.
(handle_one_xevent, x_set_window_size): Call
x_clear_under_internal_border in non-toolkit/non-GTK version.
* xterm.h (x_clear_under_internal_border): Extern it.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 76 |
1 files changed, 55 insertions, 21 deletions
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 | ||
| 600 | void | ||
| 601 | x_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) | |||
| 602 | static void | 628 | static void |
| 603 | x_after_update_window_line (struct window *w, struct glyph_row *desired_row) | 629 | x_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 | ||
| 639 | static void | 669 | static 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 | ||