about summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-18 17:53:33 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-20 00:34:20 +0100
commitb9530ad5d1cd29e176c9f16b92f1983993b22049 (patch)
treeca1bf3adff5bb71f1898d8f7d1685c806e67db4b
parentAdapted titlechange() (diff)
downloadsurf-b9530ad5d1cd29e176c9f16b92f1983993b22049.tar.gz
surf-b9530ad5d1cd29e176c9f16b92f1983993b22049.tar.bz2
surf-b9530ad5d1cd29e176c9f16b92f1983993b22049.zip
Modify the context name of the hit tests
These relate more to the position of the pointer when an event occurs.
-rw-r--r--config.def.h14
-rw-r--r--surf.c16
2 files changed, 16 insertions, 14 deletions
diff --git a/config.def.h b/config.def.h
index 55e6da4..a274b1e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -129,12 +129,12 @@ static Key keys[] = {
 };
 
 /* button definitions */
-/* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */
+/* where can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
 static Button buttons[] = {
-	/* click        event mask  button  function        argument */
-	{ ClkLink,      0,          2,      linkopenembed,  { 0 } },
-	{ ClkLink,      MODKEY,     2,      linkopen,       { 0 } },
-	{ ClkLink,      MODKEY,     1,      linkopen,       { 0 } },
-	{ ClkAny,       0,          8,      navigate,       { .i = -1 } },
-	{ ClkAny,       0,          9,      navigate,       { .i = +1 } },
+	/* where        event mask      button  function        argument        stop event */
+	{ OnLink,       0,              2,      linkopenembed,  { 0 },          1 },
+	{ OnLink,       MODKEY,         2,      linkopen,       { 0 },          1 },
+	{ OnLink,       MODKEY,         1,      linkopen,       { 0 },          1 },
+	{ OnAny,        0,              8,      navigate,       { .i = -1 },    1 },
+	{ OnAny,        0,              9,      navigate,       { .i = +1 },    1 },
 };
diff --git a/surf.c b/surf.c
index 1b3a8e0..22a3e8a 100644
--- a/surf.c
+++ b/surf.c
@@ -35,14 +35,16 @@ char *argv0;
 #define CLEANMASK(mask)         (mask & (MODKEY|GDK_SHIFT_MASK))
 
 enum { AtomFind, AtomGo, AtomUri, AtomLast };
+
 enum {
-	ClkDoc   = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
-	ClkLink  = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK,
-	ClkImg   = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE,
-	ClkMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA,
-	ClkSel   = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION,
-	ClkEdit  = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE,
-	ClkAny   = ClkDoc | ClkLink | ClkImg | ClkMedia | ClkSel | ClkEdit,
+	OnDoc   = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
+	OnLink  = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK,
+	OnImg   = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE,
+	OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA,
+	OnEdit  = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE,
+	OnBar   = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR,
+	OnSel   = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION,
+	OnAny   = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel,
 };
 
 typedef union Arg Arg;