diff --git a/src/rxvt.h b/src/rxvt.h
index e19f201..067bd8c 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -609,6 +609,8 @@ typedef struct _mwmhints
 
 /* convert pixel dimensions to row/column values.  Everything as int32_t */
 #define Pixel2Col(x)            Pixel2Width((int32_t)(x))
+#define Pixel2ColSelectionExtend(x) \
+                                ((int32_t)(x) / (int32_t)fwidth + ((int32_t)ncol * (int32_t)fwidth - 1 == (int32_t)(x) && 1 < (int32_t)fwidth))
 #define Pixel2Row(y)            Pixel2Height((int32_t)(y))
 #define Pixel2Width(x)          ((int32_t)(x) / (int32_t)fwidth)
 #define Pixel2Height(y)         ((int32_t)(y) / (int32_t)fheight)
diff --git a/src/screen.C b/src/screen.C
index 715e845..81493fd 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -3282,7 +3282,7 @@ rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, r
 void
 rxvt_term::selection_extend (int x, int y, int flag) NOTHROW
 {
-  int col = clamp (Pixel2Col (x), 0, ncol);
+  int col = clamp (Pixel2ColSelectionExtend (x), 0, ncol);
   int row = clamp (Pixel2Row (y), 0, nrow - 1);
 
   /*
