[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r115343: Remove fringe background extension code on
From: |
YAMAMOTO Mitsuharu |
Subject: |
[Emacs-diffs] trunk r115343: Remove fringe background extension code on X11. |
Date: |
Mon, 02 Dec 2013 01:06:15 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 115343
revision-id: address@hidden
parent: address@hidden
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: trunk
timestamp: Mon 2013-12-02 10:05:57 +0900
message:
Remove fringe background extension code on X11.
* xterm.h (struct scroll_bar): Remove member `fringe_extended_p'.
* xterm.c (x_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.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
src/xterm.h xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2013-12-01 17:09:18 +0000
+++ b/src/ChangeLog 2013-12-02 01:05:57 +0000
@@ -1,3 +1,14 @@
+2013-12-02 YAMAMOTO Mitsuharu <address@hidden>
+
+ * xterm.h (struct scroll_bar): Remove member `fringe_extended_p'.
+
+ * xterm.c (x_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-01 Paul Eggert <address@hidden>
Fix minor problems found by static checking.
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2013-11-30 16:25:51 +0000
+++ b/src/xterm.c 2013-12-02 01:05:57 +0000
@@ -653,10 +653,8 @@
/* 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
@@ -666,54 +664,8 @@
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);
@@ -3128,33 +3080,6 @@
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;
@@ -4991,7 +4916,6 @@
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
@@ -5167,44 +5091,17 @@
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))
@@ -5212,18 +5109,12 @@
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
{
@@ -5234,11 +5125,11 @@
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;
@@ -5246,55 +5137,31 @@
#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);
@@ -5303,17 +5170,15 @@
#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
=== modified file 'src/xterm.h'
--- a/src/xterm.h 2013-11-30 09:25:31 +0000
+++ b/src/xterm.h 2013-12-02 01:05:57 +0000
@@ -812,10 +812,6 @@
/* Last scroll bar part seen in xaw_jump_callback and xaw_scroll_callback.
*/
enum scroll_bar_part last_seen_part;
#endif
-
- /* 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. */
- unsigned fringe_extended_p : 1;
};
/* Turning a lisp vector value into a pointer to a struct scroll_bar. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r115343: Remove fringe background extension code on X11.,
YAMAMOTO Mitsuharu <=