aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <[email protected]>2008-01-21 09:59:25 +0000
committerYAMAMOTO Mitsuharu <[email protected]>2008-01-21 09:59:25 +0000
commit1ec6ded98799401fdf9535bb6cd3510dfee4d76a (patch)
treef6ca6eb1fbfc72973290498fb6dadfd0190639ec /src
parentdcb4156958af974a982e5d39230787563e311f7a (diff)
(x_scroll_bar_create): Initialize bar->redraw_needed_p.
(XTset_vertical_scroll_bar): Redraw scroll bar if bar->redraw_needed_p is set even without positional changes. (x_scroll_bar_clear): Set bar->redraw_needed_p.
Diffstat (limited to 'src')
-rw-r--r--src/macterm.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 82bd085a9b..b110f0372f 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -4998,6 +4998,7 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
XSETINT (bar->start, 0);
XSETINT (bar->end, 0);
bar->dragging = Qnil;
+ bar->redraw_needed_p = Qnil;
#ifdef USE_TOOLKIT_SCROLL_BARS
bar->track_top = Qnil;
bar->track_height = Qnil;
@@ -5193,10 +5194,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
BLOCK_INPUT;
/* If already correctly positioned, do nothing. */
- if (!(XINT (bar->left) == sb_left
- && XINT (bar->top) == top
- && XINT (bar->width) == sb_width
- && XINT (bar->height) == height))
+ if (XINT (bar->left) == sb_left
+ && XINT (bar->top) == top
+ && XINT (bar->width) == sb_width
+ && XINT (bar->height) == height)
+ {
+ if (!NILP (bar->redraw_needed_p))
+ {
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (f);
+#endif
+ Draw1Control (SCROLL_BAR_CONTROL_HANDLE (bar));
+ }
+ }
+ else
{
/* Since toolkit scroll bars are smaller than the space reserved
for them on the frame, we have to clear "under" them. */
@@ -5229,6 +5240,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
UNBLOCK_INPUT;
}
+ bar->redraw_needed_p = Qnil;
+
#ifdef USE_TOOLKIT_SCROLL_BARS
if (NILP (bar->track_top))
{
@@ -5581,8 +5594,15 @@ void
x_scroll_bar_clear (f)
FRAME_PTR f;
{
- XTcondemn_scroll_bars (f);
- XTjudge_scroll_bars (f);
+ Lisp_Object bar;
+
+ /* We can have scroll bars even if this is 0,
+ if we just turned off scroll bar mode.
+ But in that case we should not clear them. */
+ if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
+ for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar);
+ bar = XSCROLL_BAR (bar)->next)
+ XSCROLL_BAR (bar)->redraw_needed_p = Qt;
}