sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 6bae8cc297776780572b024700d28e44f0ee4256
parent 59df2f35a3e647801c418cb76f7410213396fc40
Author: Marcin sZpak <szpak@reakcja.org>
Date:   Fri, 13 Apr 2018 14:47:36 +0200

[surf] patch enable faster scroll by delta_y multiplier

Diffstat:
surf.suckless.org/patches/scroll-faster/index.md | 21+++++++++++++++++++++
surf.suckless.org/patches/scroll-faster/surf-scrollmultiply-2.0.diff | 40++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/patches/scroll-faster/index.md b/surf.suckless.org/patches/scroll-faster/index.md @@ -0,0 +1,21 @@ +Scroll faster +============= + +Description +----------- + +This patch allows you to make your mouse wheel scroll faster. It simply multiplies delta_y got from GDK event and pass it forward. + +I would be nice to make it per txt file configuration and systemwide, but I cannot make it work that way. If it's possible then please let me know. I tried systemd hwdb config but didn't success. + +At the moment it's hardcoded to factor 7. Change it per your needs. + +Download +-------- + +* [surf-scrollmultiply-2.0.diff](surf-scrollmultiply-2.0.diff) (3405) (20180413) + +Authors +------- + +* Marcin sZpak <[szpak@reakcja.org](mailto:szpak@reakcja.org)> diff --git a/surf.suckless.org/patches/scroll-faster/surf-scrollmultiply-2.0.diff b/surf.suckless.org/patches/scroll-faster/surf-scrollmultiply-2.0.diff @@ -0,0 +1,40 @@ +Only in surf: config.h +Only in surf: surf +diff -up surf-2.0/surf.c surf/surf.c +--- surf-2.0/surf.c 2018-04-13 10:55:11.036959113 +0200 ++++ surf/surf.c 2018-04-13 14:23:07.738793004 +0200 +@@ -179,6 +179,8 @@ static void initwebextensions(WebKitWebC + static GtkWidget *createview(WebKitWebView *v, WebKitNavigationAction *a, + Client *c); + static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, Client *c); ++static gboolean scrollmultiply(GtkWidget *w, GdkEvent *e, Client *c); ++ + static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, + gpointer d); + static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c); +@@ -1152,6 +1154,8 @@ newview(Client *c, WebKitWebView *rv) + G_CALLBACK(titlechanged), c); + g_signal_connect(G_OBJECT(v), "button-release-event", + G_CALLBACK(buttonreleased), c); ++ g_signal_connect(G_OBJECT(v), "scroll-event", ++ G_CALLBACK(scrollmultiply), c); + g_signal_connect(G_OBJECT(v), "close", + G_CALLBACK(closeview), c); + g_signal_connect(G_OBJECT(v), "create", +@@ -1229,6 +1233,16 @@ buttonreleased(GtkWidget *w, GdkEvent *e + return FALSE; + } + ++gboolean ++scrollmultiply(GtkWidget *w, GdkEvent *e, Client *c) ++{ ++ int i; ++ ++ e->scroll.delta_y*=7; ++ ++ return FALSE; ++} ++ + GdkFilterReturn + processx(GdkXEvent *e, GdkEvent *event, gpointer d) + {