summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-21 19:53:29 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-21 19:53:29 +0100
commit954a7181970f61acd54ce82cdff4195e72530db1 (patch)
tree94632ffa9ed89e16c7eb6004408edef6fcb13e26 /surf.c
parent26eb2f761c70036bae3a4ee866adb21e9dd97695 (diff)
downloadsurf-954a7181970f61acd54ce82cdff4195e72530db1.tar.gz
surf-954a7181970f61acd54ce82cdff4195e72530db1.tar.bz2
surf-954a7181970f61acd54ce82cdff4195e72530db1.zip
Add mouse function to play medias in external player
Control + left click launches mpv with the target media url.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/surf.c b/surf.c
index 9c9bae7..81ba9a5 100644
--- a/surf.c
+++ b/surf.c
@@ -178,6 +178,7 @@ static void find(Client *c, const Arg *a);
/* Buttons */
static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
static void clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h);
+static void clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h);
static char winid[64];
static char togglestats[10];
@@ -1462,6 +1463,17 @@ clicknewwindow(Client *c, const Arg *a, WebKitHitTestResult *h)
newwindow(c, &arg, a->b);
}
+void
+clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h)
+{
+ Arg arg;
+
+ if (webkit_hit_test_result_get_context(h) & OnMedia) {
+ arg = (Arg)VIDEOPLAY(webkit_hit_test_result_get_media_uri(h));
+ spawn(c, &arg);
+ }
+}
+
int
main(int argc, char *argv[])
{