diff options
author | Daniel Carl <danielcarl@gmx.de> | 2020-02-29 01:03:31 +0100 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2020-02-29 01:03:31 +0100 |
commit | a212b513c7354ec2a41acb680e30d085fe7f3347 (patch) | |
tree | 498e39e5edda9ff705c1185f6c18cd85e83b070e /src/main.c | |
parent | acf798ad7acc1a004d573dfdf1ae7c5d7005a2d5 (diff) |
Allow to set scroll-multiplier #602.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -116,6 +116,7 @@ static WebKitWebView *webview_new(Client *c, WebKitWebView *webview); static void on_counted_matches(WebKitFindController *finder, guint count, Client *c); static gboolean on_permission_request(WebKitWebView *webview, WebKitPermissionRequest *request, Client *c); +static gboolean on_scroll(WebKitWebView *webview, GdkEvent *event, Client *c); static void on_script_message_focus(WebKitUserContentManager *manager, WebKitJavascriptResult *res, gpointer data); static gboolean profileOptionArgFunc(const gchar *option_name, @@ -1999,6 +2000,7 @@ static WebKitWebView *webview_new(Client *c, WebKitWebView *webview) "signal::notify::title", G_CALLBACK(on_webview_notify_title), c, "signal::notify::uri", G_CALLBACK(on_webview_notify_uri), c, "signal::permission-request", G_CALLBACK(on_permission_request), c, + "signal::scroll-event", G_CALLBACK(on_scroll), c, "signal::ready-to-show", G_CALLBACK(on_webview_ready_to_show), c, "signal::web-process-crashed", G_CALLBACK(on_webview_web_process_crashed), c, "signal::authenticate", G_CALLBACK(on_webview_authenticate), c, @@ -2067,6 +2069,12 @@ static gboolean on_permission_request(WebKitWebView *webview, return TRUE; } +static gboolean on_scroll(WebKitWebView *webview, GdkEvent *event, Client *c) +{ + event->scroll.delta_y *= c->config.scrollmultiplier; + return FALSE; +} + static void on_script_message_focus(WebKitUserContentManager *manager, WebKitJavascriptResult *res, gpointer data) { |