/* Must clip because of partially visible lines. */
x_clip_to_row (w, row, ANY_AREA, gc);
- if (!p->overlay_p)
+ if (p->bx >= 0 && !p->overlay_p)
{
- int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny;
-
/* In case the same realized face is used for fringes and
for something displayed in the text (e.g. face `region' on
mono-displays, the fill style may have been changed to
else
XSetForeground (display, face->gc, face->background);
-#ifdef USE_TOOLKIT_SCROLL_BARS
- /* 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;
- }
- }
- }
-#endif
- if (bx >= 0 && nx > 0)
- XFillRectangle (display, window, face->gc, bx, by, nx, ny);
+ XFillRectangle (display, window, face->gc,
+ p->bx, p->by, p->nx, p->ny);
if (!face->stipple)
XSetForeground (display, face->gc, face->foreground);
fringe of W. */
window_box (w, ANY_AREA, &x, &y, &width, &height);
-#ifdef USE_TOOLKIT_SCROLL_BARS
- /* 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;
- }
- }
-#endif
-
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 = -1;
- bar->fringe_extended_p = 0;
#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
bar->last_seen_part = scroll_bar_nowhere;
#endif
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;
-#ifdef USE_TOOLKIT_SCROLL_BARS
- bool fringe_extended_p;
-#endif
/* 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. */
-#ifdef USE_TOOLKIT_SCROLL_BARS
- 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);
-#else
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
- sb_left = left + width - sb_width;
- else
- sb_left = left;
-#endif
-
-#ifdef USE_TOOLKIT_SCROLL_BARS
- fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
-#endif
+ width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
/* Does the scroll bar exist yet? */
if (NILP (w->vertical_scroll_bar))
if (width > 0 && height > 0)
{
block_input ();
-#ifdef USE_TOOLKIT_SCROLL_BARS
- if (fringe_extended_p)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- sb_left, top, sb_width, height);
- else
-#endif
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height);
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height);
unblock_input ();
}
- bar = x_scroll_bar_create (w, top, sb_left, sb_width, max (height, 1));
+ bar = x_scroll_bar_create (w, top, left, width, max (height, 1));
}
else
{
block_input ();
- if (sb_left != bar->left)
+ if (left != bar->left)
mask |= CWX;
if (top != bar->top)
mask |= CWY;
- if (sb_width != bar->width)
+ if (width != bar->width)
mask |= CWWidth;
if (height != bar->height)
mask |= CWHeight;
#ifdef USE_TOOLKIT_SCROLL_BARS
/* Move/size the scroll bar widget. */
- if (mask || bar->fringe_extended_p != fringe_extended_p)
+ if (mask)
{
/* Since toolkit scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
if (width > 0 && height > 0)
- {
- if (fringe_extended_p)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- sb_left, top, sb_width, height);
- else
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height);
- }
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height);
#ifdef USE_GTK
xg_update_scrollbar_pos (f, bar->x_window, top,
- sb_left, sb_width, max (height, 1));
+ left, width, max (height, 1));
#else /* not USE_GTK */
XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
- sb_left, top, sb_width, max (height, 1), 0);
+ left, top, width, max (height, 1), 0);
#endif /* not USE_GTK */
}
#else /* not USE_TOOLKIT_SCROLL_BARS */
- /* Clear areas not covered by the scroll bar because it's not as
- wide as the area reserved for it. This makes sure a
- previous mode line display is cleared after C-x 2 C-x 1, for
- example. */
- {
- int area_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
- int rest = area_width - sb_width;
- if (rest > 0 && height > 0)
- {
- if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left + area_width - rest, top, rest, height);
- else
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, rest, height);
- }
- }
-
/* Move/size the scroll bar window. */
if (mask)
{
XWindowChanges wc;
- wc.x = sb_left;
+ wc.x = left;
wc.y = top;
- wc.width = sb_width;
+ wc.width = width;
wc.height = height;
XConfigureWindow (FRAME_X_DISPLAY (f), bar->x_window,
mask, &wc);
#endif /* not USE_TOOLKIT_SCROLL_BARS */
/* 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 ();
}
#ifdef USE_TOOLKIT_SCROLL_BARS
- bar->fringe_extended_p = fringe_extended_p;
-
x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
#else /* not USE_TOOLKIT_SCROLL_BARS */
/* Set the scroll bar's current state, unless we're currently being