From 372f3c09f22097ad7f076f2f56a959ca9215320f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 7 Jul 2019 16:50:23 +0200 Subject: [urxvt] Add patch for secondary wheel behavior --- x11-terms/rxvt-unicode/secondaryWheel.patch | 119 ++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 x11-terms/rxvt-unicode/secondaryWheel.patch diff --git a/x11-terms/rxvt-unicode/secondaryWheel.patch b/x11-terms/rxvt-unicode/secondaryWheel.patch new file mode 100644 index 0000000..3bb71b8 --- /dev/null +++ b/x11-terms/rxvt-unicode/secondaryWheel.patch @@ -0,0 +1,119 @@ +diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod +index 87042cd..9dfb861 100644 +--- a/doc/rxvt.1.pod ++++ b/doc/rxvt.1.pod +@@ -417,6 +417,11 @@ B. + Turn on/off secondary screen scroll (default enabled); resource + B. + ++=item B<-ssw>|B<+ssw> ++ ++Turn on/off secondary screen wheel support (default disabled); resource ++B. ++ + =item B<-hold>|B<+hold> + + Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@ +@@ -1029,6 +1034,13 @@ option is enabled, scrolls on the secondary screen will change the + scrollback buffer and, when secondaryScreen is off, switching + to/from the secondary screen will instead scroll the screen up. + ++=item B I ++ ++Turn on/off secondary wheel (default disabled). If enabled, when on ++secondary screen, using the mouse wheel will not scroll in the buffer ++but instead send 3 "fake" keystrokes (Up/Down arrow) to the running ++application (allows e.g. natural scrolling in B, B, etc). ++ + =item B: I + + Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@ +diff --git a/src/command.C b/src/command.C +index 153f0e1..df22652 100644 +--- a/src/command.C ++++ b/src/command.C +@@ -2246,10 +2246,46 @@ rxvt_term::button_release (XButtonEvent &ev) + } + else + # endif ++#ifndef NO_SECONDARY_SCREEN + { +- scr_page (dirn, lines); +- scrollBar.show (1); ++ /* on SECONDARY screen, we send "fake" UP/DOWN keys instead ++ * (this allows to scroll within man, less, etc) */ ++ if (option (Opt_secondaryWheel) && current_screen != PRIMARY) ++ { ++ XKeyEvent event; ++ event.display = ev.display; ++ event.window = ev.window; ++ event.root = ev.root; ++ event.subwindow = ev.subwindow; ++ event.time = ev.time; ++ event.x = ev.x; ++ event.y = ev.y; ++ event.x_root = ev.x_root; ++ event.y_root = ev.y_root; ++ event.same_screen = ev.same_screen; ++ event.state = 0; ++ event.keycode = XKeysymToKeycode(ev.display, ++ (dirn == UP) ? XK_Up : XK_Down); ++ for ( ; lines > 0; --lines) ++ { ++ event.type = KeyPress; ++ XSendEvent (event.display, event.window, True, ++ KeyPressMask, (XEvent *) &event); ++ event.type = KeyRelease; ++ XSendEvent (event.display, event.window, True, ++ KeyPressMask, (XEvent *) &event); ++ } ++ } ++ /* on PRIMARY screen, we scroll in the buffer */ ++ else ++#endif ++ { ++ scr_page (dirn, lines); ++ scrollBar.show (1); ++ } ++#ifndef NO_SECONDARY_SCREEN + } ++#endif + } + break; + #endif +diff --git a/src/optinc.h b/src/optinc.h +index d814035..a365037 100644 +--- a/src/optinc.h ++++ b/src/optinc.h +@@ -26,6 +26,7 @@ + def(cursorBlink) + def(secondaryScreen) + def(secondaryScroll) ++ def(secondaryWheel) + def(pastableTabs) + def(cursorUnderline) + #if ENABLE_FRILLS +diff --git a/src/rsinc.h b/src/rsinc.h +index 1483955..10f6642 100644 +--- a/src/rsinc.h ++++ b/src/rsinc.h +@@ -103,6 +103,7 @@ + #ifndef NO_SECONDARY_SCREEN + def (secondaryScreen) + def (secondaryScroll) ++ def (secondaryWheel) + #endif + #if OFF_FOCUS_FADING + def (fade) +diff --git a/src/xdefaults.C b/src/xdefaults.C +index 69acdd8..3e858de 100644 +--- a/src/xdefaults.C ++++ b/src/xdefaults.C +@@ -262,6 +262,7 @@ optList[] = { + #ifndef NO_SECONDARY_SCREEN + BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, 0, "enable secondary screen"), + BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, 0, "enable secondary screen scroll"), ++ BOOL (Rs_secondaryWheel, "secondaryWheel", "ssw", Opt_secondaryWheel, 0, "enable secondary screen wheel"), + #endif + #if ENABLE_PERL + RSTRG (Rs_perl_lib, "perl-lib", "string"), //, "colon-separated directories with extension scripts"),TODO -- cgit v1.2.3