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];
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;
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 */
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))
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
{
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))
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;
/* 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);