On Sun, Dec 18, 2011 at 3:53 PM, Mikael Magnusson <[email protected]> wrote:
> This is the first release candidate of urxvt 9.13:
>
>  http://data.plan9.de/rxvt-unicode-9.12.tar.bz2

Have compiled it.  Seems to work.  Will report if I find anything amiss.

My old patches still work with these version.  I've been using older
versions of these patches with urxvt 9.10 for ages.  I attach updated
copies of them to this mail in case someone else wants to use them.

The first patch, urxvt-selectright4.patch , changes selection
behaviour so that if the mouse pointer is on the rightmost pixel of
the rightmost character, it counts as being past the line (not on that
last character).  As I'm usually running urxvt without a border, so
this rightmost pixel of the rightmost column is often the absolute
rightmost pixel of the screen, without this patch I have no way to
select till the end of a line in vanilla urxvt.  This patch fixes
that.

The second patch, urxvt-forbidmouse4.patch , adds an escape sequence
that forbids applications to enable mouse reporting private modes.  I
am using this because some applications insist on using mouse
reporting and there's no easy way to disable that behaviour, so this
patch to urxvt provides an easy workaround.  If you apply this patch,
you need to run make alldoc.

The third patch, urxvt-xtermdoc4.patch , is not too significant but is
included for completeness: it documents some escape sequences xterm
has that urxvt is unlikely to implement, but might still be useful to
avoid clashes in case we add escape sequences later.  You also have to
run make alldoc if you apply this.

Ambrus
commit ff5779b8d56f19b86ddb91e52830f4699f6588d8
Author: Zsbán Ambrus <[email protected]>
Date:   Tue Dec 20 21:24:52 2011 +0100

    Mouse on rightmost pixel of rightmost column is treated as if it was past rightmost column.

diff --git a/src/rxvt.h b/src/rxvt.h
index 98bacb5..27a4ee6 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -641,6 +641,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 e75a38f..4391f0e 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -3106,7 +3106,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);
 
   /*
commit 312b0c82782bff0b39b7f4b93facc241f1012351
Author: Zsbán Ambrus <[email protected]>
Date:   Tue Dec 20 21:28:12 2011 +0100

    Add private mode to forbid apps to enable mouse reporting

diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index 86a5637..0dcb155 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2015,6 +2015,15 @@ example - anybody out there who needs this?).
 
 =end table
 
+=item B<< C<Pm = 1062> >>
+
+=begin table
+
+	B<< C<h> >>	Forbid enabling mouse reporting modes: application trying to enable mouse reporting private modes will have no effect
+	B<< C<l> >>	Allow enabling mouse reporting modes
+
+=end table
+
 =item B<< C<Pm = 2004> >>
 
 =begin table
diff --git a/src/command.C b/src/command.C
index c088ea2..3c90fa1 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3660,6 +3660,7 @@ rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int na
                  // 1048 save and restore cursor, implemented in code
                   { 1049, PrivMode_Screen }, /* xterm extension, clear screen on ti rather than te */
                  // 1051, 1052, 1060, 1061 keyboard emulation NYI
+                  { 1062, PrivMode_MouseForbid },
                   { 2004, PrivMode_BracketPaste },
                 };
 
@@ -3735,6 +3736,8 @@ rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int na
             case 9:			/* X10 mouse reporting */
               if (state)		/* orthogonal */
                 priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
+              if (priv_modes & PrivMode_MouseForbid)
+                priv_modes &= ~PrivMode_MouseX10;
               break;
 #ifdef scrollBar_esc
             case scrollBar_esc:
@@ -3758,10 +3761,14 @@ rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int na
             case 1000:		/* X11 mouse reporting */
               if (state)		/* orthogonal */
                 priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
+              if (priv_modes & PrivMode_MouseForbid)
+                priv_modes &= ~PrivMode_MouseX11;
               break;
             case 1002:
             case 1003:
-              if (state)
+              if (state && priv_modes & PrivMode_MouseForbid)
+                priv_modes &= ~PrivMode_MouseBtnEvent & ~PrivMode_MouseAnyEvent;
+              else if (state)
                 {
                   priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11);
                   priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent;
diff --git a/src/rxvt.h b/src/rxvt.h
index 27a4ee6..f6fd4d7 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -571,6 +571,7 @@ enum {
 #define PrivMode_BracketPaste   (1UL<<22)
 #define PrivMode_ExtModeMouse   (1UL<<23) // xterm pseudo-utf-8 hack
 #define PrivMode_ExtMouseRight  (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales
+#define PrivMode_MouseForbid    (1UL<<25)
 
 #define PrivMode_mouse_report   (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent)
 
commit 1592d44b11cd3be79e9e25eccc718f64bd4b93cd
Author: Zsbán Ambrus <[email protected]>
Date:   Tue Dec 20 21:33:14 2011 +0100

    Document some xterm features to avoid future clashes

diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index 0dcb155..4ce83cb 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2033,6 +2033,15 @@ example - anybody out there who needs this?).
 
 =end table
 
+=item B<< C<Pm = 2007> >> (X11 xterm) I<unimplemented>
+
+=begin table
+
+	B<< C<h> >>	Report mouse position if mouse dragged off the edge of the window
+	B<< C<l> >>	Report mouse position only inside window
+
+=end table
+
 =back
 
 =back
diff --git a/src/command.C b/src/command.C
index 3c90fa1..707dd23 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3662,6 +3662,7 @@ rxvt_term::process_terminal_mode (int mode, int priv ecb_unused, unsigned int na
                  // 1051, 1052, 1060, 1061 keyboard emulation NYI
                   { 1062, PrivMode_MouseForbid },
                   { 2004, PrivMode_BracketPaste },
+                 // 2007 xterm report mouse drags off edge
                 };
 
   if (nargs == 0)
diff --git a/src/rxvt.h b/src/rxvt.h
index f6fd4d7..d1ec341 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -414,6 +414,7 @@ enum {
   XTerm_konsole30        = 30,      // reserved for konsole
   XTerm_konsole31        = 31,      // reserved for konsole
   XTerm_emacs51          = 51,      // reserved for emacs shell
+  XTerm_Xselection       = 52,      // not implemented, xterm read or write X11 selection
   /*
    * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL)
    */
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to