1. Nic Ferrier
  2. emacs

Commits

Richard M. Stallman  committed a02555b

(x_scroll_bar_create, x_scroll_bar_move):
(x_scroll_bar_expose): Use VERTICAL_SCROLL_BAR_WIDTH_TRIM.

(XTchange_line_highlight, dumpglyphs, XTclear_end_of_line)
(do_line_dance, pixel_to_glyph_coords): Use FRAME_WINDOW_WIDTH.

(x_scroll_bar_move, x_scroll_bar_create):
Add a border around the actual window.

(x_scroll_bar_expose): Don't trim the width here.

  • Participants
  • Parent commits 0a31bd9
  • Branches default

Comments (0)

Files changed (1)

File src/xterm.c

View file
  • Ignore whitespace
 {
   highlight = new_highlight;
   XTcursor_to (vpos, 0);
-  XTclear_end_of_line (updating_frame->width);
+  XTclear_end_of_line (FRAME_WINDOW_WIDTH (updating_frame));
 }
 
 /* This is used when starting Emacs and when restarting after suspend.
      int just_foreground;
 {
   /* Holds characters to be displayed. */
-  char *buf = (char *) alloca (f->width * sizeof (*buf));
+  char *buf = (char *) alloca (FRAME_WINDOW_WIDTH (f) * sizeof (*buf));
   register char *cp;		/* Steps through buf[]. */
   register int tlen = GLYPH_TABLE_LENGTH;
   register Lisp_Object *tbase = GLYPH_TABLE_BASE;
   if (first_unused <= 0)
     return;
 
-  if (first_unused >= f->width)
-    first_unused = f->width;
+  if (first_unused >= FRAME_WINDOW_WIDTH (f))
+    first_unused = FRAME_WINDOW_WIDTH (f);
 
   first_unused += FRAME_LEFT_SCROLL_BAR_WIDTH (f);
 
 	XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 		   FRAME_X_WINDOW (f), f->output_data.x->normal_gc,
 		   intborder, CHAR_TO_PIXEL_ROW (f, i+distance),
-		   f->width * FONT_WIDTH (f->output_data.x->font),
+		   FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font),
 		   (j-i) * f->output_data.x->line_height,
 		   intborder, CHAR_TO_PIXEL_ROW (f, i));
 	i = j-1;
 	XCopyArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 		   FRAME_X_WINDOW (f), f->output_data.x->normal_gc,
 		   intborder, CHAR_TO_PIXEL_ROW (f, j+1+distance),
-		   f->width * FONT_WIDTH (f->output_data.x->font),
+		   FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font),
 		   (i-j) * f->output_data.x->line_height,
 		   intborder, CHAR_TO_PIXEL_ROW (f, j+1));
 	i = j+1;
 	/* Clear [i,j) */
 	XClearArea (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 		    intborder, CHAR_TO_PIXEL_ROW (f, i),
-		    f->width * FONT_WIDTH (f->output_data.x->font),
+		    FRAME_WINDOW_WIDTH (f) * FONT_WIDTH (f->output_data.x->font),
 		    (j-i) * f->output_data.x->line_height, False);
 	i = j-1;
       }
     {
       if (pix_x < 0)
 	pix_x = 0;
-      else if (pix_x > f->width)
-	pix_x = f->width;
+      else if (pix_x > FRAME_WINDOW_WIDTH (f))
+	pix_x = FRAME_WINDOW_WIDTH (f);
 
       if (pix_y < 0)
 	pix_y = 0;
        XCreateWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
 
 		      /* Position and size of scroll bar.  */
-		      left, top, width, height,
+		      left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, top,
+		      width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, height,
 
 		      /* Border width, depth, class, and visual.  */
 		      0, CopyFromParent, CopyFromParent, CopyFromParent,
     XWindowChanges wc;
     unsigned int mask = 0;
 
-    wc.x = left;
+    wc.x = left + VERTICAL_SCROLL_BAR_WIDTH_TRIM;
     wc.y = top;
-    wc.width = width;
+
+    wc.width = width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2;
     wc.height = height;
 
     if (left != XINT (bar->left))	mask |= CWX;
   Window w = SCROLL_BAR_X_WINDOW (bar);
   FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
   GC gc = f->output_data.x->normal_gc;
-  int width_trim = (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
-		    ? LEFT_VERTICAL_SCROLL_BAR_WIDTH_TRIM
-		    : 0);
+  int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM;
 
   BLOCK_INPUT;
 
 
 		  /* x, y, width, height */
 		  0, 0,
-		  XINT (bar->width) - 1 - width_trim,
+		  XINT (bar->width) - 1 - width_trim - width_trim,
 		  XINT (bar->height) - 1);
     
   UNBLOCK_INPUT;