emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible merge conflict in src/macterm.[ch]


From: Miles Bader
Subject: Possible merge conflict in src/macterm.[ch]
Date: Tue, 22 Jan 2008 19:05:11 -0500

Hi,

I merged the appended changes to macterm.[ch] from the Emacs 22 release
branch to the trunk.  As there were merge conflicts, and apparently some
trunk changes touched the same code, it seems likely that either this
change shouldn't have been merged, or that I incorrectly resolved the
conflict.

Please check the state of macterm.[ch] in the trunk and make sure it is
correct.

[The appended ChangeLog entry is the original, but the diff is the
change I applied to the trunk, after I tried to fix the conflicts.]

Thanks,

-Miles


2008-01-21  YAMAMOTO Mitsuharu  <address@hidden>

        * macterm.c (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.

        * macterm.h (struct scroll_bar): New member `redraw_needed_p'.

--- orig/src/macterm.h
+++ mod/src/macterm.h
@@ -457,6 +457,9 @@
   Lisp_Object fringe_extended_p;
 #endif
 
+  /* t if redraw needed in the next XTset_vertical_scroll_bar call.  */
+  Lisp_Object redraw_needed_p;
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
   /* The position and size of the scroll bar handle track area in
      pixels, relative to the frame.  */

--- orig/src/macterm.c
+++ mod/src/macterm.c
@@ -5069,6 +5069,7 @@
 #ifdef MAC_OSX
   bar->fringe_extended_p = Qnil;
 #endif
+  bar->redraw_needed_p = Qnil;
 #ifdef USE_TOOLKIT_SCROLL_BARS
   bar->track_top = Qnil;
   bar->track_height = Qnil;
@@ -5285,14 +5286,24 @@
       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
 #ifdef MAC_OSX
-           && !NILP (bar->fringe_extended_p) == fringe_extended_p
+         && !NILP (bar->fringe_extended_p) == fringe_extended_p
 #endif
-           ))
+         )
+       {
+         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.  */
@@ -5334,6 +5345,8 @@
   bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
 #endif
 
+  bar->redraw_needed_p = Qnil;
+
 #ifdef USE_TOOLKIT_SCROLL_BARS
   if (NILP (bar->track_top))
     {
@@ -5691,8 +5704,15 @@
 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;
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]