[wiki] [sites] [surf] patch enable faster scroll by delta_y multiplier || Marcin sZpak

From: <git_AT_suckless.org>
Date: Fri, 13 Apr 2018 14:49:10 +0200

commit 6bae8cc297776780572b024700d28e44f0ee4256
Author: Marcin sZpak <szpak_AT_reakcja.org>
Date: Fri Apr 13 14:47:36 2018 +0200

    [surf] patch enable faster scroll by delta_y multiplier

diff --git a/surf.suckless.org/patches/scroll-faster/index.md b/surf.suckless.org/patches/scroll-faster/index.md
new file mode 100644
index 00000000..bf0580b2
--- /dev/null
+++ b/surf.suckless.org/patches/scroll-faster/index.md
_AT_@ -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_AT_reakcja.org](mailto:szpak_AT_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
new file mode 100644
index 00000000..4e834cae
--- /dev/null
+++ b/surf.suckless.org/patches/scroll-faster/surf-scrollmultiply-2.0.diff
_AT_@ -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
+_AT_@ -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);
+_AT_@ -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",
+_AT_@ -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)
+ {
Received on Fri Apr 13 2018 - 14:49:10 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 13 2018 - 15:00:25 CEST