From: YAMAMOTO Mitsuharu Date: Sat, 21 Dec 2013 07:04:07 +0000 (+0900) Subject: Remove fringe background extension code on W32. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~280 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b2b60f0f88e1785b1edbf9be8427fb6f2e717ff;p=emacs.git Remove fringe background extension code on W32. * w32term.h (struct scroll_bar): Remove member `fringe_extended_p'. * w32term.c (w32_draw_fringe_bitmap, x_scroll_run): Remove code for fringe background extension. (x_scroll_bar_create): Remove variables `sb_left' and `sb_width', because they are now always the same as `left' and `width', respectively. Remove code for the case that `width' and `sb_width' are different. --- diff --git a/src/ChangeLog b/src/ChangeLog index dbb77ae1646..ecde9e1ddea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2013-12-21 YAMAMOTO Mitsuharu + + * w32term.h (struct scroll_bar): Remove member `fringe_extended_p'. + + * w32term.c (w32_draw_fringe_bitmap, x_scroll_run): Remove code for + fringe background extension. + (x_scroll_bar_create): Remove variables `sb_left' and `sb_width', + because they are now always the same as `left' and `width', + respectively. Remove code for the case that `width' and + `sb_width' are different. + 2013-12-20 Martin Rudalics Remove scroll_bar_actual_width from frames. diff --git a/src/w32term.c b/src/w32term.c index a39ab37768c..583e0ebaf31 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -792,62 +792,13 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row, hdc = get_frame_dc (f); - if (!p->overlay_p) - { - int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny; - - /* If the fringe is adjacent to the left (right) scroll bar of a - leftmost (rightmost, respectively) window, then extend its - background to the gap between the fringe and the bar. */ - if ((WINDOW_LEFTMOST_P (w) - && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) - || (WINDOW_RIGHTMOST_P (w) - && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) - { - int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); - - if (sb_width > 0) - { - int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); - int bar_area_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); - - if (bx < 0) - { - /* Bitmap fills the fringe. */ - if (bar_area_x + bar_area_width == p->x) - bx = bar_area_x + sb_width; - else if (p->x + p->wd == bar_area_x) - bx = bar_area_x; - if (bx >= 0) - { - int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); - - nx = bar_area_width - sb_width; - by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, - row->y)); - ny = row->visible_height; - } - } - else - { - if (bar_area_x + bar_area_width == bx) - { - bx = bar_area_x + sb_width; - nx += bar_area_width - sb_width; - } - else if (bx + nx == bar_area_x) - nx += bar_area_width - sb_width; - } - } - } - - if (bx >= 0 && nx > 0) - w32_fill_area (f, hdc, face->background, bx, by, nx, ny); - } - /* Must clip because of partially visible lines. */ w32_clip_to_row (w, row, ANY_AREA, hdc); + if (p->bx >= 0 && !p->overlay_p) + w32_fill_area (f, hdc, face->background, + p->bx, p->by, p->nx, p->ny); + if (p->which && p->which < max_fringe_bmp) { HBITMAP pixmap = fringe_bmp[p->which]; @@ -2693,31 +2644,6 @@ x_scroll_run (struct window *w, struct run *run) fringes of W. */ window_box (w, ANY_AREA, &x, &y, &width, &height); - /* If the fringe is adjacent to the left (right) scroll bar of a - leftmost (rightmost, respectively) window, then extend its - background to the gap between the fringe and the bar. */ - if ((WINDOW_LEFTMOST_P (w) - && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) - || (WINDOW_RIGHTMOST_P (w) - && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) - { - int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); - - if (sb_width > 0) - { - int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); - int bar_area_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); - - if (bar_area_x + bar_area_width == x) - { - x = bar_area_x + sb_width; - width += bar_area_width - sb_width; - } - else if (x + width == bar_area_x) - width += bar_area_width - sb_width; - } - } - from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); bottom_y = y + height; @@ -3719,7 +3645,6 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height) bar->start = 0; bar->end = 0; bar->dragging = 0; - bar->fringe_extended_p = 0; /* Requires geometry to be set before call to create the real window */ @@ -3781,33 +3706,17 @@ w32_set_vertical_scroll_bar (struct window *w, struct frame *f = XFRAME (w->frame); Lisp_Object barobj; struct scroll_bar *bar; - int top, height, left, sb_left, width, sb_width; + int top, height, left, width; int window_y, window_height; - bool fringe_extended_p; /* Get window dimensions. */ window_box (w, ANY_AREA, 0, &window_y, 0, &window_height); top = window_y; - width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); height = window_height; - /* Compute the left edge of the scroll bar area. */ + /* Compute the left edge and the width of the scroll bar area. */ left = WINDOW_SCROLL_BAR_AREA_X (w); - - /* Compute the width of the scroll bar which might be less than - the width of the area reserved for the scroll bar. */ - if (WINDOW_CONFIG_SCROLL_BAR_WIDTH (w) > 0) - sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); - else - sb_width = width; - - /* Compute the left edge of the scroll bar. */ - if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) - sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0); - else - sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); - - fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w); + width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); /* Does the scroll bar exist yet? */ if (NILP (w->vertical_scroll_bar)) @@ -3817,15 +3726,12 @@ w32_set_vertical_scroll_bar (struct window *w, if (width > 0 && height > 0) { hdc = get_frame_dc (f); - if (fringe_extended_p) - w32_clear_area (f, hdc, sb_left, top, sb_width, height); - else - w32_clear_area (f, hdc, left, top, width, height); + w32_clear_area (f, hdc, left, top, width, height); release_frame_dc (f, hdc); } unblock_input (); - bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); + bar = x_scroll_bar_create (w, top, left, width, height); } else { @@ -3836,11 +3742,10 @@ w32_set_vertical_scroll_bar (struct window *w, hwnd = SCROLL_BAR_W32_WINDOW (bar); /* If already correctly positioned, do nothing. */ - if (bar->left == sb_left + if (bar->left == left && bar->top == top - && bar->width == sb_width - && bar->height == height - && bar->fringe_extended_p == fringe_extended_p) + && bar->width == width + && bar->height == height) { /* Redraw after clear_frame. */ if (!my_show_window (f, hwnd, SW_NORMAL)) @@ -3857,17 +3762,13 @@ w32_set_vertical_scroll_bar (struct window *w, hdc = get_frame_dc (f); /* Since Windows scroll bars are smaller than the space reserved for them on the frame, we have to clear "under" them. */ - if (fringe_extended_p) - w32_clear_area (f, hdc, sb_left, top, sb_width, height); - else - w32_clear_area (f, hdc, left, top, width, height); + w32_clear_area (f, hdc, left, top, width, height); release_frame_dc (f, hdc); } /* Make sure scroll bar is "visible" before moving, to ensure the area of the parent window now exposed will be refreshed. */ my_show_window (f, hwnd, SW_HIDE); - MoveWindow (hwnd, sb_left, top, sb_width, - max (height, 1), TRUE); + MoveWindow (hwnd, left, top, width, max (height, 1), TRUE); si.cbSize = sizeof (si); si.fMask = SIF_RANGE; @@ -3881,16 +3782,14 @@ w32_set_vertical_scroll_bar (struct window *w, /* InvalidateRect (w, NULL, FALSE); */ /* Remember new settings. */ - bar->left = sb_left; + bar->left = left; bar->top = top; - bar->width = sb_width; + bar->width = width; bar->height = height; unblock_input (); } } - bar->fringe_extended_p = fringe_extended_p; - w32_set_scroll_bar_thumb (bar, portion, position, whole); XSETVECTOR (barobj, bar); wset_vertical_scroll_bar (w, barobj); diff --git a/src/w32term.h b/src/w32term.h index b8a1823d7b0..0372bb1e970 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -449,12 +449,6 @@ struct scroll_bar { place where the user grabbed it. If the handle isn't currently being dragged, this is Qnil. */ int dragging; - - /* 1 if the background of the fringe that is adjacent to a scroll - bar is extended to the gap between the fringe and the bar. */ - /* Note: this could be a bit field, but we need to take its address - in ALLOCATE_PSEUDOVECTOR (see x_scroll_bar_create). */ - bool fringe_extended_p; }; /* Turning a lisp vector value into a pointer to a struct scroll_bar. */