]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_set_toolkit_scroll_bar_thumb): Don't set control
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 23 Feb 2006 10:43:32 +0000 (10:43 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 23 Feb 2006 10:43:32 +0000 (10:43 +0000)
values if control is not visible or values are not changed.

src/ChangeLog
src/macterm.c

index ea7a5e7d70b1e4ed7ae7ff03736634a72f6058a6..fe8b13409efb34346c5ba5d38982cba53d27f901 100644 (file)
@@ -7,6 +7,9 @@
        * dispnew.c (update_text_area): Avoid needless redraw of rightmost
        glyph whose face is extended to the text area end.
 
+       * macterm.c (x_set_toolkit_scroll_bar_thumb): Don't set control
+       values if control is not visible or values are not changed.
+
 2006-02-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * window.c (Fwindow_list): Check `window' before doing XWINDOW.
index 5fd416be6b85dd93df32d19f4a188016dde3e198..3bd7d3b2e24407265a071649be68bc13f439fb3c 100644 (file)
@@ -4529,7 +4529,7 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
      int portion, position, whole;
 {
   ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
-  int value, viewsize, maximum, visible_p;
+  int value, viewsize, maximum;
 
   if (whole == 0 || XINT (bar->track_height) == 0)
     value = 0, viewsize = 1, maximum = 0;
@@ -4542,16 +4542,20 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
 
   BLOCK_INPUT;
 
-  /* Temporarily hide the scroll bar to avoid multiple redraws.  */
-  visible_p = IsControlVisible (ch);
-  SetControlVisibility (ch, false, false);
+  if (IsControlVisible (ch)
+      && (GetControlViewSize (ch) != viewsize
+         || GetControl32BitValue (ch) != value
+         || GetControl32BitMaximum (ch) != maximum))
+    {
+      /* Temporarily hide the scroll bar to avoid multiple redraws.  */
+      SetControlVisibility (ch, false, false);
 
-  SetControl32BitMinimum (ch, 0);
-  SetControl32BitMaximum (ch, maximum);
-  SetControl32BitValue (ch, value);
-  SetControlViewSize (ch, viewsize);
+      SetControl32BitMaximum (ch, maximum);
+      SetControl32BitValue (ch, value);
+      SetControlViewSize (ch, viewsize);
 
-  SetControlVisibility (ch, visible_p, true);
+      SetControlVisibility (ch, true, true);
+    }
 
   UNBLOCK_INPUT;
 }