summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-09-29 15:45:02 +0200
committerKarel Kočí <cynerd@email.cz>2019-09-29 15:45:02 +0200
commit15facd86d007d6295cd7a03fecfcf5cba14cd59f (patch)
treec6d2f6a8ea4bacff2b0221caf03dd7b42c371be2 /surf.c
parent5105baa9342399c74dd5feb5697efcf041f8c80c (diff)
downloadsurf-15facd86d007d6295cd7a03fecfcf5cba14cd59f.tar.gz
surf-15facd86d007d6295cd7a03fecfcf5cba14cd59f.tar.bz2
surf-15facd86d007d6295cd7a03fecfcf5cba14cd59f.zip
Apply patch surf-popup-2.0.diff
https://surf.suckless.org/patches/popup-on-gesture/surf-popup-2.0.diff
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/surf.c b/surf.c
index b76f19c..f553239 100644
--- a/surf.c
+++ b/surf.c
@@ -1256,12 +1256,13 @@ createview(WebKitWebView *v, WebKitNavigationAction *a, Client *c)
switch (webkit_navigation_action_get_navigation_type(a)) {
case WEBKIT_NAVIGATION_TYPE_OTHER: /* fallthrough */
/*
- * popup windows of type “other” are almost always triggered
- * by user gesture, so inverse the logic here
+ * allow same-window popup triggered by user gesture
*/
-/* instead of this, compare destination uri to mouse-over uri for validating window */
- if (webkit_navigation_action_is_user_gesture(a))
+ if (webkit_navigation_action_is_user_gesture(a)) {
+ Arg aa = {.v = webkit_uri_request_get_uri(webkit_navigation_action_get_request(a))};
+ loaduri((Client *) c, &aa);
return NULL;
+ }
case WEBKIT_NAVIGATION_TYPE_LINK_CLICKED: /* fallthrough */
case WEBKIT_NAVIGATION_TYPE_FORM_SUBMITTED: /* fallthrough */
case WEBKIT_NAVIGATION_TYPE_BACK_FORWARD: /* fallthrough */