Hello,

It appears that I have built rxvt-unicode-9.18 with my custom patches
successfully.

My old patches apply cleanly, so I attach versions of them based on
rxvt-unicode-9.18 to this mail.  Apply these patches by changing to
the rxvt-unicode-9.18 directory then redirecting the patch files to
`patch -p1' then running `make alldoc'.  See below for description on
what the patches do.


On 12/20/11, Zsbán Ambrus <[email protected]> wrote:
> 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 8bc680057eb38f09b10aebe2b12f582e015c19e2
Author: Zsbán Ambrus <[email protected]>
Date:   Sat Apr 6 20:14:58 2013 +0200

    Add .DELETE_ON_ERROR pragma to Makefiles.

diff --git a/doc/Makefile.in b/doc/Makefile.in
index 7a8ad31..fd13f1a 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -25,6 +25,8 @@ VPATH = @srcdir@
 first_rule: all
 dummy:
 
+.DELETE_ON_ERROR:
+
 #-------------------------------------------------------------------------
 
 SEDREPLACE = -e 's%@@RXVT_VERSION@@%$(VERSION)%g;'	\
diff --git a/src/Makefile.in b/src/Makefile.in
index 33c950c..a3533cb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -35,6 +35,8 @@ VPATH = @srcdir@
 first_rule: all
 dummy:
 
+.DELETE_ON_ERROR:
+
 COMMON = \
 	background.o command.o rxvtfont.o init.o main.o misc.o \
 	screen.o scrollbar.o scrollbar-next.o scrollbar-rxvt.o \
commit 1449cb4b7712da9743c344aedece6bca3708d83d
Author: Zsbán Ambrus <[email protected]>
Date:   Sat Apr 6 20:18:15 2013 +0200

    Add escape sequence to forbid mouse reporting modes.
    
    After applying this, regenerate docs with `make alldoc'.

diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index 9c90331..2d433fe 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2018,6 +2018,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 82ad10a..ceea371 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3697,6 +3697,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 },
                 };
 
@@ -3772,6 +3773,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:
@@ -3793,10 +3796,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 8a6c895..4ae109e 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -651,6 +651,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 7f34cb350b8e29db37698b6626719314c7f173ae
Author: Zsbán Ambrus <[email protected]>
Date:   Sat Apr 6 20:21:23 2013 +0200

    Improve mouse selection for borderless xterm.
    
    Mouse on rightmost pixel of rightmost character is now taken to point to 
    past the end of the line.  This makes it easier to select a line in a 
    borderless xterm aligned to the very edge of the screen.

diff --git a/src/rxvt.h b/src/rxvt.h
index 4ae109e..48bacb4 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -722,6 +722,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 60a95ba..6276d31 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -3114,7 +3114,7 @@ rxvt_term::selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, r
 void ecb_cold
 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 917787516a7fef5ad8634892effe1e2649cf6bda
Author: Zsbán Ambrus <[email protected]>
Date:   Sat Apr 6 20:22:18 2013 +0200

    Document some xterm features unimplemented in rxvt.
    
    After applying this, regenerate docs with `make alldoc'.
    

diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index 2d433fe..7e11423 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2036,6 +2036,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 ceea371..c98e037 100644
--- a/src/command.C
+++ b/src/command.C
@@ -3699,6 +3699,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 48bacb4..aefe591 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -494,6 +494,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