diff options
| author | YAMAMOTO Mitsuharu | 2011-05-11 12:13:58 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2011-05-11 12:13:58 +0900 |
| commit | 7db47798f82694ea85003f3ea004600ab6a68fc3 (patch) | |
| tree | eeed4c4a9f50fa70a4406f44f73e12d2e21bc3f0 /src | |
| parent | 3ee240faef2c679ecf9eb6b99ac22b9e75b23f08 (diff) | |
| download | emacs-7db47798f82694ea85003f3ea004600ab6a68fc3.tar.gz emacs-7db47798f82694ea85003f3ea004600ab6a68fc3.zip | |
Take account of fringe background extension in scroll_run_hook.
* w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
`width' to `bar_area_x' and `bar_area_width', respectively.
(x_scroll_run): Take account of fringe background extension.
* xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename
local vars `left' and `width' to `bar_area_x' and
`bar_area_width', respectively.
(x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
background extension.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/w32term.c | 52 | ||||
| -rw-r--r-- | src/xterm.c | 54 |
3 files changed, 92 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4ab5b4e64f1..6ed7883ded4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and | ||
| 4 | `width' to `bar_area_x' and `bar_area_width', respectively. | ||
| 5 | (x_scroll_run): Take account of fringe background extension. | ||
| 6 | |||
| 7 | * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename | ||
| 8 | local vars `left' and `width' to `bar_area_x' and | ||
| 9 | `bar_area_width', respectively. | ||
| 10 | (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe | ||
| 11 | background extension. | ||
| 12 | |||
| 1 | 2011-05-09 Andreas Schwab <schwab@linux-m68k.org> | 13 | 2011-05-09 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 14 | ||
| 3 | * xmenu.c (set_frame_menubar): Fix submenu loops. | 15 | * xmenu.c (set_frame_menubar): Fix submenu loops. |
diff --git a/src/w32term.c b/src/w32term.c index 387f2b5c59f..83789788b3c 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -781,22 +781,22 @@ w32_draw_fringe_bitmap (w, row, p) | |||
| 781 | 781 | ||
| 782 | if (sb_width > 0) | 782 | if (sb_width > 0) |
| 783 | { | 783 | { |
| 784 | int left = WINDOW_SCROLL_BAR_AREA_X (w); | 784 | int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); |
| 785 | int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | 785 | int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) |
| 786 | * FRAME_COLUMN_WIDTH (f)); | 786 | * FRAME_COLUMN_WIDTH (f)); |
| 787 | 787 | ||
| 788 | if (bx < 0) | 788 | if (bx < 0) |
| 789 | { | 789 | { |
| 790 | /* Bitmap fills the fringe. */ | 790 | /* Bitmap fills the fringe. */ |
| 791 | if (left + width == p->x) | 791 | if (bar_area_x + bar_area_width == p->x) |
| 792 | bx = left + sb_width; | 792 | bx = bar_area_x + sb_width; |
| 793 | else if (p->x + p->wd == left) | 793 | else if (p->x + p->wd == bar_area_x) |
| 794 | bx = left; | 794 | bx = bar_area_x; |
| 795 | if (bx >= 0) | 795 | if (bx >= 0) |
| 796 | { | 796 | { |
| 797 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | 797 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); |
| 798 | 798 | ||
| 799 | nx = width - sb_width; | 799 | nx = bar_area_width - sb_width; |
| 800 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | 800 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
| 801 | row->y)); | 801 | row->y)); |
| 802 | ny = row->visible_height; | 802 | ny = row->visible_height; |
| @@ -804,13 +804,13 @@ w32_draw_fringe_bitmap (w, row, p) | |||
| 804 | } | 804 | } |
| 805 | else | 805 | else |
| 806 | { | 806 | { |
| 807 | if (left + width == bx) | 807 | if (bar_area_x + bar_area_width == bx) |
| 808 | { | 808 | { |
| 809 | bx = left + sb_width; | 809 | bx = bar_area_x + sb_width; |
| 810 | nx += width - sb_width; | 810 | nx += bar_area_width - sb_width; |
| 811 | } | 811 | } |
| 812 | else if (bx + nx == left) | 812 | else if (bx + nx == bar_area_x) |
| 813 | nx += width - sb_width; | 813 | nx += bar_area_width - sb_width; |
| 814 | } | 814 | } |
| 815 | } | 815 | } |
| 816 | } | 816 | } |
| @@ -2625,6 +2625,32 @@ x_scroll_run (w, run) | |||
| 2625 | fringes of W. */ | 2625 | fringes of W. */ |
| 2626 | window_box (w, -1, &x, &y, &width, &height); | 2626 | window_box (w, -1, &x, &y, &width, &height); |
| 2627 | 2627 | ||
| 2628 | /* If the fringe is adjacent to the left (right) scroll bar of a | ||
| 2629 | leftmost (rightmost, respectively) window, then extend its | ||
| 2630 | background to the gap between the fringe and the bar. */ | ||
| 2631 | if ((WINDOW_LEFTMOST_P (w) | ||
| 2632 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | ||
| 2633 | || (WINDOW_RIGHTMOST_P (w) | ||
| 2634 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) | ||
| 2635 | { | ||
| 2636 | int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); | ||
| 2637 | |||
| 2638 | if (sb_width > 0) | ||
| 2639 | { | ||
| 2640 | int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); | ||
| 2641 | int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | ||
| 2642 | * FRAME_COLUMN_WIDTH (f)); | ||
| 2643 | |||
| 2644 | if (bar_area_x + bar_area_width == x) | ||
| 2645 | { | ||
| 2646 | x = bar_area_x + sb_width; | ||
| 2647 | width += bar_area_width - sb_width; | ||
| 2648 | } | ||
| 2649 | else if (x + width == bar_area_x) | ||
| 2650 | width += bar_area_width - sb_width; | ||
| 2651 | } | ||
| 2652 | } | ||
| 2653 | |||
| 2628 | from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); | 2654 | from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
| 2629 | to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); | 2655 | to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
| 2630 | bottom_y = y + height; | 2656 | bottom_y = y + height; |
diff --git a/src/xterm.c b/src/xterm.c index be7fde03c58..f6b6dcef7a2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -804,22 +804,22 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 804 | 804 | ||
| 805 | if (sb_width > 0) | 805 | if (sb_width > 0) |
| 806 | { | 806 | { |
| 807 | int left = WINDOW_SCROLL_BAR_AREA_X (w); | 807 | int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); |
| 808 | int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | 808 | int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) |
| 809 | * FRAME_COLUMN_WIDTH (f)); | 809 | * FRAME_COLUMN_WIDTH (f)); |
| 810 | 810 | ||
| 811 | if (bx < 0) | 811 | if (bx < 0) |
| 812 | { | 812 | { |
| 813 | /* Bitmap fills the fringe. */ | 813 | /* Bitmap fills the fringe. */ |
| 814 | if (left + width == p->x) | 814 | if (bar_area_x + bar_area_width == p->x) |
| 815 | bx = left + sb_width; | 815 | bx = bar_area_x + sb_width; |
| 816 | else if (p->x + p->wd == left) | 816 | else if (p->x + p->wd == bar_area_x) |
| 817 | bx = left; | 817 | bx = bar_area_x; |
| 818 | if (bx >= 0) | 818 | if (bx >= 0) |
| 819 | { | 819 | { |
| 820 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | 820 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); |
| 821 | 821 | ||
| 822 | nx = width - sb_width; | 822 | nx = bar_area_width - sb_width; |
| 823 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | 823 | by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
| 824 | row->y)); | 824 | row->y)); |
| 825 | ny = row->visible_height; | 825 | ny = row->visible_height; |
| @@ -827,13 +827,13 @@ x_draw_fringe_bitmap (w, row, p) | |||
| 827 | } | 827 | } |
| 828 | else | 828 | else |
| 829 | { | 829 | { |
| 830 | if (left + width == bx) | 830 | if (bar_area_x + bar_area_width == bx) |
| 831 | { | 831 | { |
| 832 | bx = left + sb_width; | 832 | bx = bar_area_x + sb_width; |
| 833 | nx += width - sb_width; | 833 | nx += bar_area_width - sb_width; |
| 834 | } | 834 | } |
| 835 | else if (bx + nx == left) | 835 | else if (bx + nx == bar_area_x) |
| 836 | nx += width - sb_width; | 836 | nx += bar_area_width - sb_width; |
| 837 | } | 837 | } |
| 838 | } | 838 | } |
| 839 | } | 839 | } |
| @@ -3240,6 +3240,34 @@ x_scroll_run (w, run) | |||
| 3240 | fringe of W. */ | 3240 | fringe of W. */ |
| 3241 | window_box (w, -1, &x, &y, &width, &height); | 3241 | window_box (w, -1, &x, &y, &width, &height); |
| 3242 | 3242 | ||
| 3243 | #ifdef USE_TOOLKIT_SCROLL_BARS | ||
| 3244 | /* If the fringe is adjacent to the left (right) scroll bar of a | ||
| 3245 | leftmost (rightmost, respectively) window, then extend its | ||
| 3246 | background to the gap between the fringe and the bar. */ | ||
| 3247 | if ((WINDOW_LEFTMOST_P (w) | ||
| 3248 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) | ||
| 3249 | || (WINDOW_RIGHTMOST_P (w) | ||
| 3250 | && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) | ||
| 3251 | { | ||
| 3252 | int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); | ||
| 3253 | |||
| 3254 | if (sb_width > 0) | ||
| 3255 | { | ||
| 3256 | int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); | ||
| 3257 | int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) | ||
| 3258 | * FRAME_COLUMN_WIDTH (f)); | ||
| 3259 | |||
| 3260 | if (bar_area_x + bar_area_width == x) | ||
| 3261 | { | ||
| 3262 | x = bar_area_x + sb_width; | ||
| 3263 | width += bar_area_width - sb_width; | ||
| 3264 | } | ||
| 3265 | else if (x + width == bar_area_x) | ||
| 3266 | width += bar_area_width - sb_width; | ||
| 3267 | } | ||
| 3268 | } | ||
| 3269 | #endif | ||
| 3270 | |||
| 3243 | from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); | 3271 | from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
| 3244 | to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); | 3272 | to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
| 3245 | bottom_y = y + height; | 3273 | bottom_y = y + height; |