Modify the context name of the hit tests

These relate more to the position of the pointer when an event occurs.
This commit is contained in:
Quentin Rameau 2015-11-18 17:53:33 +01:00
parent 60f574e4b7
commit b9530ad5d1
2 changed files with 16 additions and 14 deletions

View file

@ -129,12 +129,12 @@ static Key keys[] = {
}; };
/* button definitions */ /* 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[] = { static Button buttons[] = {
/* click event mask button function argument */ /* where event mask button function argument stop event */
{ ClkLink, 0, 2, linkopenembed, { 0 } }, { OnLink, 0, 2, linkopenembed, { 0 }, 1 },
{ ClkLink, MODKEY, 2, linkopen, { 0 } }, { OnLink, MODKEY, 2, linkopen, { 0 }, 1 },
{ ClkLink, MODKEY, 1, linkopen, { 0 } }, { OnLink, MODKEY, 1, linkopen, { 0 }, 1 },
{ ClkAny, 0, 8, navigate, { .i = -1 } }, { OnAny, 0, 8, navigate, { .i = -1 }, 1 },
{ ClkAny, 0, 9, navigate, { .i = +1 } }, { OnAny, 0, 9, navigate, { .i = +1 }, 1 },
}; };

16
surf.c
View file

@ -35,14 +35,16 @@ char *argv0;
#define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK)) #define CLEANMASK(mask) (mask & (MODKEY|GDK_SHIFT_MASK))
enum { AtomFind, AtomGo, AtomUri, AtomLast }; enum { AtomFind, AtomGo, AtomUri, AtomLast };
enum { enum {
ClkDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT, OnDoc = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
ClkLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK, OnLink = WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK,
ClkImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE, OnImg = WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE,
ClkMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA, OnMedia = WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA,
ClkSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION, OnEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE,
ClkEdit = WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE, OnBar = WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR,
ClkAny = ClkDoc | ClkLink | ClkImg | ClkMedia | ClkSel | ClkEdit, OnSel = WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION,
OnAny = OnDoc | OnLink | OnImg | OnMedia | OnEdit | OnBar | OnSel,
}; };
typedef union Arg Arg; typedef union Arg Arg;