diff options
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 98 |
1 files changed, 82 insertions, 16 deletions
diff --git a/src/w32term.c b/src/w32term.c index a17fa2de918..fb312010728 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -7,7 +7,7 @@ This file is part of GNU Emacs. | |||
| 7 | 7 | ||
| 8 | GNU Emacs is free software; you can redistribute it and/or modify | 8 | GNU Emacs is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation; either version 2, or (at your option) | 10 | the Free Software Foundation; either version 3, or (at your option) |
| 11 | any later version. | 11 | any later version. |
| 12 | 12 | ||
| 13 | GNU Emacs is distributed in the hope that it will be useful, | 13 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -682,6 +682,60 @@ w32_draw_fringe_bitmap (w, row, p) | |||
| 682 | 682 | ||
| 683 | hdc = get_frame_dc (f); | 683 | hdc = get_frame_dc (f); |
| 684 | 684 | ||
| 685 | if (!p->overlay_p) | ||
| 686 | { | ||
| 687 | int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny; | ||
| 688 | |||
| 689 | /* If the fringe is adjacent to the left (right) scroll bar of a | ||
| 690 | leftmost (rightmost, respectively) window, then extend its | ||
| 691 | background to the gap between the fringe and the bar. */ | ||
| 692 | if ((WINDOW_LEFTMOST_P (w) | ||
| 693 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | ||
| 694 | || (WINDOW_RIGHTMOST_P (w) | ||
| 695 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) | ||
| 696 | { | ||
| 697 | int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); | ||
| 698 | |||
| 699 | if (sb_width > 0) | ||
| 700 | { | ||
| 701 | int left = WINDOW_SCROLL_BAR_AREA_X (w); | ||
| 702 | int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | ||
| 703 | * FRAME_COLUMN_WIDTH (f)); | ||
| 704 | |||
| 705 | if (bx < 0) | ||
| 706 | { | ||
| 707 | /* Bitmap fills the fringe. */ | ||
| 708 | if (left + width == p->x) | ||
| 709 | bx = left + sb_width; | ||
| 710 | else if (p->x + p->wd == left) | ||
| 711 | bx = left; | ||
| 712 | if (bx >= 0) | ||
| 713 | { | ||
| 714 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | ||
| 715 | |||
| 716 | nx = width - sb_width; | ||
| 717 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 718 | row->y)); | ||
| 719 | ny = row->visible_height; | ||
| 720 | } | ||
| 721 | } | ||
| 722 | else | ||
| 723 | { | ||
| 724 | if (left + width == bx) | ||
| 725 | { | ||
| 726 | bx = left + sb_width; | ||
| 727 | nx += width - sb_width; | ||
| 728 | } | ||
| 729 | else if (bx + nx == left) | ||
| 730 | nx += width - sb_width; | ||
| 731 | } | ||
| 732 | } | ||
| 733 | } | ||
| 734 | |||
| 735 | if (bx >= 0 && nx > 0) | ||
| 736 | w32_fill_area (f, hdc, face->background, bx, by, nx, ny); | ||
| 737 | } | ||
| 738 | |||
| 685 | /* Must clip because of partially visible lines. */ | 739 | /* Must clip because of partially visible lines. */ |
| 686 | rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 740 | rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
| 687 | if (p->y < rowY) | 741 | if (p->y < rowY) |
| @@ -699,12 +753,6 @@ w32_draw_fringe_bitmap (w, row, p) | |||
| 699 | else | 753 | else |
| 700 | w32_clip_to_row (w, row, -1, hdc); | 754 | w32_clip_to_row (w, row, -1, hdc); |
| 701 | 755 | ||
| 702 | if (p->bx >= 0 && !p->overlay_p) | ||
| 703 | { | ||
| 704 | w32_fill_area (f, hdc, face->background, | ||
| 705 | p->bx, p->by, p->nx, p->ny); | ||
| 706 | } | ||
| 707 | |||
| 708 | if (p->which && p->which < max_fringe_bmp) | 756 | if (p->which && p->which < max_fringe_bmp) |
| 709 | { | 757 | { |
| 710 | HBITMAP pixmap = fringe_bmp[p->which]; | 758 | HBITMAP pixmap = fringe_bmp[p->which]; |
| @@ -3614,6 +3662,7 @@ x_scroll_bar_create (w, top, left, width, height) | |||
| 3614 | XSETINT (bar->start, 0); | 3662 | XSETINT (bar->start, 0); |
| 3615 | XSETINT (bar->end, 0); | 3663 | XSETINT (bar->end, 0); |
| 3616 | bar->dragging = Qnil; | 3664 | bar->dragging = Qnil; |
| 3665 | bar->fringe_extended_p = Qnil; | ||
| 3617 | 3666 | ||
| 3618 | /* Requires geometry to be set before call to create the real window */ | 3667 | /* Requires geometry to be set before call to create the real window */ |
| 3619 | 3668 | ||
| @@ -3677,6 +3726,7 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3677 | struct scroll_bar *bar; | 3726 | struct scroll_bar *bar; |
| 3678 | int top, height, left, sb_left, width, sb_width; | 3727 | int top, height, left, sb_left, width, sb_width; |
| 3679 | int window_y, window_height; | 3728 | int window_y, window_height; |
| 3729 | int fringe_extended_p; | ||
| 3680 | 3730 | ||
| 3681 | /* Get window dimensions. */ | 3731 | /* Get window dimensions. */ |
| 3682 | window_box (w, -1, 0, &window_y, 0, &window_height); | 3732 | window_box (w, -1, 0, &window_y, 0, &window_height); |
| @@ -3696,9 +3746,20 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3696 | 3746 | ||
| 3697 | /* Compute the left edge of the scroll bar. */ | 3747 | /* Compute the left edge of the scroll bar. */ |
| 3698 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) | 3748 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) |
| 3699 | sb_left = left + width - sb_width - (width - sb_width) / 2; | 3749 | sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0); |
| 3750 | else | ||
| 3751 | sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); | ||
| 3752 | |||
| 3753 | if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | ||
| 3754 | fringe_extended_p = (WINDOW_LEFTMOST_P (w) | ||
| 3755 | && WINDOW_LEFT_FRINGE_WIDTH (w) | ||
| 3756 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 3757 | || WINDOW_LEFT_MARGIN_COLS (w) == 0)); | ||
| 3700 | else | 3758 | else |
| 3701 | sb_left = left + (width - sb_width) / 2; | 3759 | fringe_extended_p = (WINDOW_RIGHTMOST_P (w) |
| 3760 | && WINDOW_RIGHT_FRINGE_WIDTH (w) | ||
| 3761 | && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | ||
| 3762 | || WINDOW_RIGHT_MARGIN_COLS (w) == 0)); | ||
| 3702 | 3763 | ||
| 3703 | /* Does the scroll bar exist yet? */ | 3764 | /* Does the scroll bar exist yet? */ |
| 3704 | if (NILP (w->vertical_scroll_bar)) | 3765 | if (NILP (w->vertical_scroll_bar)) |
| @@ -3708,7 +3769,10 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3708 | if (width > 0 && height > 0) | 3769 | if (width > 0 && height > 0) |
| 3709 | { | 3770 | { |
| 3710 | hdc = get_frame_dc (f); | 3771 | hdc = get_frame_dc (f); |
| 3711 | w32_clear_area (f, hdc, left, top, width, height); | 3772 | if (fringe_extended_p) |
| 3773 | w32_clear_area (f, hdc, sb_left, top, sb_width, height); | ||
| 3774 | else | ||
| 3775 | w32_clear_area (f, hdc, left, top, width, height); | ||
| 3712 | release_frame_dc (f, hdc); | 3776 | release_frame_dc (f, hdc); |
| 3713 | } | 3777 | } |
| 3714 | UNBLOCK_INPUT; | 3778 | UNBLOCK_INPUT; |
| @@ -3727,7 +3791,8 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3727 | if ( XINT (bar->left) == sb_left | 3791 | if ( XINT (bar->left) == sb_left |
| 3728 | && XINT (bar->top) == top | 3792 | && XINT (bar->top) == top |
| 3729 | && XINT (bar->width) == sb_width | 3793 | && XINT (bar->width) == sb_width |
| 3730 | && XINT (bar->height) == height ) | 3794 | && XINT (bar->height) == height |
| 3795 | && !NILP (bar->fringe_extended_p) == fringe_extended_p ) | ||
| 3731 | { | 3796 | { |
| 3732 | /* Redraw after clear_frame. */ | 3797 | /* Redraw after clear_frame. */ |
| 3733 | if (!my_show_window (f, hwnd, SW_NORMAL)) | 3798 | if (!my_show_window (f, hwnd, SW_NORMAL)) |
| @@ -3744,11 +3809,10 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3744 | hdc = get_frame_dc (f); | 3809 | hdc = get_frame_dc (f); |
| 3745 | /* Since Windows scroll bars are smaller than the space reserved | 3810 | /* Since Windows scroll bars are smaller than the space reserved |
| 3746 | for them on the frame, we have to clear "under" them. */ | 3811 | for them on the frame, we have to clear "under" them. */ |
| 3747 | w32_clear_area (f, hdc, | 3812 | if (fringe_extended_p) |
| 3748 | left, | 3813 | w32_clear_area (f, hdc, sb_left, top, sb_width, height); |
| 3749 | top, | 3814 | else |
| 3750 | width, | 3815 | w32_clear_area (f, hdc, left, top, width, height); |
| 3751 | height); | ||
| 3752 | release_frame_dc (f, hdc); | 3816 | release_frame_dc (f, hdc); |
| 3753 | } | 3817 | } |
| 3754 | /* Make sure scroll bar is "visible" before moving, to ensure the | 3818 | /* Make sure scroll bar is "visible" before moving, to ensure the |
| @@ -3778,6 +3842,8 @@ w32_set_vertical_scroll_bar (w, portion, whole, position) | |||
| 3778 | UNBLOCK_INPUT; | 3842 | UNBLOCK_INPUT; |
| 3779 | } | 3843 | } |
| 3780 | } | 3844 | } |
| 3845 | bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; | ||
| 3846 | |||
| 3781 | w32_set_scroll_bar_thumb (bar, portion, position, whole); | 3847 | w32_set_scroll_bar_thumb (bar, portion, position, whole); |
| 3782 | 3848 | ||
| 3783 | XSETVECTOR (w->vertical_scroll_bar, bar); | 3849 | XSETVECTOR (w->vertical_scroll_bar, bar); |