[hackers] [surf] Make it possible to open a link in a new window with holding the mod key. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Sat, 07 Sep 2013 11:59:24 +0200

commit 83df29393f99990cea6b0fff3eec66eeb94329ed
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Sat Sep 7 11:55:23 2013 +0200

    Make it possible to open a link in a new window with holding the mod key.
    
    Thanks David Dufberg Tøttrup <david_AT_dufberg.se>!

diff --git a/surf.c b/surf.c
index dfcd787..b6669ae 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -241,7 +241,8 @@ buttonrelease(WebKitWebView *web, GdkEventButton *e, GList *gl) {
 
         g_object_get(result, "context", &context, NULL);
         if(context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK) {
- if(e->button == 2) {
+ if(e->button == 2 ||
+ (e->button == 1 && CLEANMASK(e->state) == CLEANMASK(MODKEY))) {
                         g_object_get(result, "link-uri", &arg.v, NULL);
                         newwindow(NULL, &arg, e->state & GDK_CONTROL_MASK);
                         return true;
Received on Sat Sep 07 2013 - 11:59:24 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 07 2013 - 12:00:21 CEST