emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100576: Take account of fringe ba


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100576: Take account of fringe background extension in scroll_run_hook.
Date: Wed, 11 May 2011 12:13:58 +0900
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 100576
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: emacs-23
timestamp: Wed 2011-05-11 12:13:58 +0900
message:
  Take account of fringe background extension in scroll_run_hook.
  
  * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
  `width' to `bar_area_x' and `bar_area_width', respectively.
  (x_scroll_run): Take account of fringe background extension.
  
  * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename
  local vars `left' and `width' to `bar_area_x' and
  `bar_area_width', respectively.
  (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
  background extension.
modified:
  src/ChangeLog
  src/w32term.c
  src/xterm.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-05-09 11:13:02 +0000
+++ b/src/ChangeLog     2011-05-11 03:13:58 +0000
@@ -1,3 +1,15 @@
+2011-05-11  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
+       `width' to `bar_area_x' and `bar_area_width', respectively.
+       (x_scroll_run): Take account of fringe background extension.
+
+       * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]: Rename
+       local vars `left' and `width' to `bar_area_x' and
+       `bar_area_width', respectively.
+       (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
+       background extension.
+
 2011-05-09  Andreas Schwab  <address@hidden>
 
        * xmenu.c (set_frame_menubar): Fix submenu loops.

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2011-02-23 05:10:10 +0000
+++ b/src/w32term.c     2011-05-11 03:13:58 +0000
@@ -781,22 +781,22 @@
 
          if (sb_width > 0)
            {
-             int left = WINDOW_SCROLL_BAR_AREA_X (w);
-             int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
-                          * FRAME_COLUMN_WIDTH (f));
+             int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
+             int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+                                   * FRAME_COLUMN_WIDTH (f));
 
              if (bx < 0)
                {
                  /* Bitmap fills the fringe.  */
-                 if (left + width == p->x)
-                   bx = left + sb_width;
-                 else if (p->x + p->wd == left)
-                   bx = left;
+                 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 = width - sb_width;
+                     nx = bar_area_width - sb_width;
                      by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
                                                            row->y));
                      ny = row->visible_height;
@@ -804,13 +804,13 @@
                }
              else
                {
-                 if (left + width == bx)
+                 if (bar_area_x + bar_area_width == bx)
                    {
-                     bx = left + sb_width;
-                     nx += width - sb_width;
+                     bx = bar_area_x + sb_width;
+                     nx += bar_area_width - sb_width;
                    }
-                 else if (bx + nx == left)
-                   nx += width - sb_width;
+                 else if (bx + nx == bar_area_x)
+                   nx += bar_area_width - sb_width;
                }
            }
        }
@@ -2625,6 +2625,32 @@
      fringes of W.  */
   window_box (w, -1, &x, &y, &width, &height);
 
+  /* 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_COLS (w)
+                               * FRAME_COLUMN_WIDTH (f));
+
+         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;
+       }
+    }
+
   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;

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2011-04-08 19:18:25 +0000
+++ b/src/xterm.c       2011-05-11 03:13:58 +0000
@@ -804,22 +804,22 @@
 
          if (sb_width > 0)
            {
-             int left = WINDOW_SCROLL_BAR_AREA_X (w);
-             int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
-                          * FRAME_COLUMN_WIDTH (f));
+             int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
+             int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+                                   * FRAME_COLUMN_WIDTH (f));
 
              if (bx < 0)
                {
                  /* Bitmap fills the fringe.  */
-                 if (left + width == p->x)
-                   bx = left + sb_width;
-                 else if (p->x + p->wd == left)
-                   bx = left;
+                 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 = width - sb_width;
+                     nx = bar_area_width - sb_width;
                      by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
                                                            row->y));
                      ny = row->visible_height;
@@ -827,13 +827,13 @@
                }
              else
                {
-                 if (left + width == bx)
+                 if (bar_area_x + bar_area_width == bx)
                    {
-                     bx = left + sb_width;
-                     nx += width - sb_width;
+                     bx = bar_area_x + sb_width;
+                     nx += bar_area_width - sb_width;
                    }
-                 else if (bx + nx == left)
-                   nx += width - sb_width;
+                 else if (bx + nx == bar_area_x)
+                   nx += bar_area_width - sb_width;
                }
            }
        }
@@ -3240,6 +3240,34 @@
      fringe of W.  */
   window_box (w, -1, &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_COLS (w)
+                               * FRAME_COLUMN_WIDTH (f));
+
+         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;


reply via email to

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