aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2008-01-21 09:59:25 +0000
committerYAMAMOTO Mitsuharu2008-01-21 09:59:25 +0000
commit1ec6ded98799401fdf9535bb6cd3510dfee4d76a (patch)
treef6ca6eb1fbfc72973290498fb6dadfd0190639ec /src/macterm.c
parentdcb4156958af974a982e5d39230787563e311f7a (diff)
downloademacs-1ec6ded98799401fdf9535bb6cd3510dfee4d76a.tar.gz
emacs-1ec6ded98799401fdf9535bb6cd3510dfee4d76a.zip
(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/macterm.c')
-rw-r--r--src/macterm.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 82bd085a9b2..b110f0372fc 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)
4998 XSETINT (bar->start, 0); 4998 XSETINT (bar->start, 0);
4999 XSETINT (bar->end, 0); 4999 XSETINT (bar->end, 0);
5000 bar->dragging = Qnil; 5000 bar->dragging = Qnil;
5001 bar->redraw_needed_p = Qnil;
5001#ifdef USE_TOOLKIT_SCROLL_BARS 5002#ifdef USE_TOOLKIT_SCROLL_BARS
5002 bar->track_top = Qnil; 5003 bar->track_top = Qnil;
5003 bar->track_height = Qnil; 5004 bar->track_height = Qnil;
@@ -5193,10 +5194,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5193 BLOCK_INPUT; 5194 BLOCK_INPUT;
5194 5195
5195 /* If already correctly positioned, do nothing. */ 5196 /* If already correctly positioned, do nothing. */
5196 if (!(XINT (bar->left) == sb_left 5197 if (XINT (bar->left) == sb_left
5197 && XINT (bar->top) == top 5198 && XINT (bar->top) == top
5198 && XINT (bar->width) == sb_width 5199 && XINT (bar->width) == sb_width
5199 && XINT (bar->height) == height)) 5200 && XINT (bar->height) == height)
5201 {
5202 if (!NILP (bar->redraw_needed_p))
5203 {
5204#if USE_CG_DRAWING
5205 mac_prepare_for_quickdraw (f);
5206#endif
5207 Draw1Control (SCROLL_BAR_CONTROL_HANDLE (bar));
5208 }
5209 }
5210 else
5200 { 5211 {
5201 /* Since toolkit scroll bars are smaller than the space reserved 5212 /* Since toolkit scroll bars are smaller than the space reserved
5202 for them on the frame, we have to clear "under" them. */ 5213 for them on the frame, we have to clear "under" them. */
@@ -5229,6 +5240,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5229 UNBLOCK_INPUT; 5240 UNBLOCK_INPUT;
5230 } 5241 }
5231 5242
5243 bar->redraw_needed_p = Qnil;
5244
5232#ifdef USE_TOOLKIT_SCROLL_BARS 5245#ifdef USE_TOOLKIT_SCROLL_BARS
5233 if (NILP (bar->track_top)) 5246 if (NILP (bar->track_top))
5234 { 5247 {
@@ -5581,8 +5594,15 @@ void
5581x_scroll_bar_clear (f) 5594x_scroll_bar_clear (f)
5582 FRAME_PTR f; 5595 FRAME_PTR f;
5583{ 5596{
5584 XTcondemn_scroll_bars (f); 5597 Lisp_Object bar;
5585 XTjudge_scroll_bars (f); 5598
5599 /* We can have scroll bars even if this is 0,
5600 if we just turned off scroll bar mode.
5601 But in that case we should not clear them. */
5602 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
5603 for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar);
5604 bar = XSCROLL_BAR (bar)->next)
5605 XSCROLL_BAR (bar)->redraw_needed_p = Qt;
5586} 5606}
5587 5607
5588 5608