Index: src/scrollbar-next.c
===================================================================
--- src/scrollbar-next.c	(revision 1321)
+++ src/scrollbar-next.c	(working copy)
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:	scrollbar-next.c
  *----------------------------------------------------------------------*
- * $Id: scrollbar-next.c,v 1.15 2001/07/27 06:38:37 gcw Exp $
+ * $Id$
  *
  * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA>
  * Copyright (c) 1998      Alfredo K. Kojima <kojima@windowmaker.org>
@@ -228,6 +228,12 @@
 {
     int             height = r->scrollBar.end + SB_BUTTON_TOTAL_HEIGHT + SB_PADDING;
     Drawable        s;
+    /* In scrollBar-left mode, the black border must be shown on the
+       right, hence the drawing area is shifted. See rxvt-2.6.4 source
+       (scrollbar.c:569). (With the Win32 borders on Cygwin it's debatable
+       whether that's an improvement, but the 2.7.10 way doesn't look to
+       good either.) */
+    int             sbXofs = r->Options & Opt_scrollBar_right? 0 : -SB_BORDER_WIDTH;
 
     if ((r->scrollBar.init & R_SB_NEXT) == 0) {
 	r->scrollBar.init |= R_SB_NEXT;
@@ -235,50 +241,57 @@
     }
 
     if (r->TermWin.nscrolled == 0 || !update) {
-	XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->grayGC, 0, 0,
+	XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->grayGC, sbXofs, 0,
 		       SB_WIDTH_NEXT + 1, height);
-	XDrawRectangle(r->Xdisplay, r->scrollBar.win, r->h->blackGC, 0,
+	XDrawRectangle(r->Xdisplay, r->scrollBar.win, r->h->blackGC, sbXofs,
 		       -SB_BORDER_WIDTH, SB_WIDTH_NEXT,
 		       height + SB_BORDER_WIDTH);
 	XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC,
-		       SB_LEFT_PADDING, 0, SB_BUTTON_WIDTH, height);
+		       SB_LEFT_PADDING + sbXofs, SB_PADDING, SB_BUTTON_WIDTH,
+		       height - SB_MARGIN_SPACE);
     }
     if (r->TermWin.nscrolled) {
 	if (last_top < r->scrollBar.top || !update)
 	    XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC,
-			   SB_LEFT_PADDING, SB_PADDING + last_top,
+			   SB_LEFT_PADDING + sbXofs, SB_PADDING + last_top,
 			   SB_BUTTON_WIDTH, r->scrollBar.top - last_top);
 	if (r->scrollBar.bot < last_bot || !update)
 	    XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->stippleGC,
-			   SB_LEFT_PADDING, r->scrollBar.bot + SB_PADDING,
+			   SB_LEFT_PADDING + sbXofs, r->scrollBar.bot + SB_PADDING,
 			   SB_BUTTON_WIDTH, (last_bot - r->scrollBar.bot));
 	XFillRectangle(r->Xdisplay, r->scrollBar.win, r->h->grayGC,
-		       SB_LEFT_PADDING, r->scrollBar.top + SB_PADDING,
+		       SB_LEFT_PADDING + sbXofs, r->scrollBar.top + SB_PADDING,
 		       SB_BUTTON_WIDTH, scrollbar_len);
 	XCopyArea(r->Xdisplay, r->h->dimple, r->scrollBar.win, r->h->whiteGC, 0, 0,
 		  SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT,
-		  (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2,
+		  (SB_WIDTH_NEXT - SCROLLER_DIMPLE_WIDTH) / 2 + sbXofs,
 		  r->scrollBar.top + SB_BEVEL_WIDTH_UPPER_LEFT +
 		  (scrollbar_len - SCROLLER_DIMPLE_HEIGHT) / 2);
 
-	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X,
+	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X + sbXofs,
 		       r->scrollBar.top + SB_PADDING, SB_BUTTON_WIDTH,
 		       scrollbar_len);
-	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X,
+	XDrawLine(r->Xdisplay,r->scrollBar.win,r->h->grayGC,
+		  SB_PADDING + sbXofs,height - SB_BUTTON_BOTH_HEIGHT - SB_PADDING,
+		  SB_PADDING + SB_BUTTON_WIDTH + sbXofs,height - SB_BUTTON_BOTH_HEIGHT - SB_PADDING);
+	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X + sbXofs,
 		       height - SB_BUTTON_BOTH_HEIGHT, SB_BUTTON_WIDTH,
 		       SB_BUTTON_HEIGHT);
-	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X,
+	XDrawLine(r->Xdisplay,r->scrollBar.win,r->h->grayGC,
+		  SB_PADDING + sbXofs,height - SB_BUTTON_SINGLE_HEIGHT - SB_PADDING,
+		  SB_PADDING + SB_BUTTON_WIDTH + sbXofs,height - SB_BUTTON_SINGLE_HEIGHT - SB_PADDING);
+	rxvt_drawBevel(r, r->scrollBar.win, SB_BUTTON_BEVEL_X + sbXofs,
 		       height - SB_BUTTON_SINGLE_HEIGHT, SB_BUTTON_WIDTH,
 		       SB_BUTTON_HEIGHT);
 
 	s = (scrollbar_isUp()) ? r->h->upArrowHi : r->h->upArrow;
 	XCopyArea(r->Xdisplay, s, r->scrollBar.win, r->h->whiteGC, 0, 0,
-		  ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
+		  ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X + sbXofs,
 		  height - SB_BUTTON_BOTH_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
 
 	s = (scrollbar_isDn()) ? r->h->downArrowHi : r->h->downArrow;
 	XCopyArea(r->Xdisplay, s, r->scrollBar.win, r->h->whiteGC, 0, 0,
-		  ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X,
+		  ARROW_WIDTH, ARROW_HEIGHT, SB_BUTTON_FACE_X + sbXofs,
 		  height - SB_BUTTON_SINGLE_HEIGHT + SB_BEVEL_WIDTH_UPPER_LEFT);
     }
     return 1;

Property changes on: src/scrollbar-next.c
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: W11/w32/xlib.c
===================================================================
--- W11/w32/xlib.c	(revision 1321)
+++ W11/w32/xlib.c	(working copy)
@@ -1,4 +1,4 @@
-/*****************************************************************\
+/*****************************************************************	\
 
 
 	Library of X window functions which call Windows 32
@@ -1240,7 +1240,10 @@
 		oldObj = SelectObject(hDC,hpen);
 		MoveToEx(hDC,x1,y1,NULL);
 		LineTo(hDC,x2,y2);
-		SelectObject(hDC, oldObj);
+		/* RS 2012-04-09 -- do paint first & last pixels --
+		   better fit for Cygwin scrollbars. */
+		SetPixel(hDC,x2,y2,CNUMTORGB(gc->values.foreground));
+		SetPixel(hDC,x1,y1,CNUMTORGB(gc->values.foreground));
 		drawableRelDC(w,hDC);
 	}
 	return 0;
@@ -1384,9 +1387,13 @@
 		hDC = drawableGetDC(w);
 		hbrush = NT_get_GC_brush(hDC,gc);
 		rect.left=(LONG)x;
-		rect.right=(LONG)(x+width);
+		/* I believe lower right is exclusive w/ GDI; well at least,
+		 * Cygwin NeXT SB does look better if I add 1 px here.
+		 * Actually, at least the Rxvt SB had issues as well there
+		 * -- RS 2012-04-09 */
+		rect.right=(LONG)(x+width+1);
 		rect.top=(LONG)y;
-		rect.bottom=(LONG)(y+height);
+		rect.bottom=(LONG)(y+height+1);
 		oldbrush = SelectObject(hDC,GetStockObject(NULL_BRUSH));
 		hpen = NT_get_GC_pen(hDC,gc);
 		oldpen = SelectObject(hDC,hpen);

Property changes on: W11/w32/xlib.c
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
