surf-popup-2.0.diff - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
surf-popup-2.0.diff (1037B)
---
1 diff -up surf-2.0/surf.c surf/surf.c
2 --- surf-2.0/surf.c 2017-11-26 14:29:37.963786915 +0100
3 +++ surf/surf.c 2017-12-03 00:20:07.314189414 +0100
4 @@ -1183,12 +1183,13 @@ createview(WebKitWebView *v, WebKitNavig
5 switch (webkit_navigation_action_get_navigation_type(a)) {
6 case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */
7 /*
8 - * popup windows of type “other” are almost always triggered
9 - * by user gesture, so inverse the logic here
10 + * allow same-window popup triggered by user gesture
11 */
12 -/* instead of this, compare destination uri to mouse-over uri for validating window */
13 - if (webkit_navigation_action_is_user_gesture(a))
14 + if (webkit_navigation_action_is_user_gesture(a)) {
15 + Arg aa = {.v = webkit_uri_request_get_uri(webkit_navigation_action_get_request(a))};
16 + loaduri((Client *) c, &aa);
17 return NULL;
18 + }
19 case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */
20 case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */
21 case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */