summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-20 00:09:21 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-20 00:34:22 +0100
commit701815a5f22c76dafb6b25c08d0ceb87252782c0 (patch)
treefa070f56feab4395b201bf42ed5df4d7e0685c79 /surf.c
parentd6794e0d75128dda9be6bd4769e2cd81a57192c7 (diff)
downloadsurf-701815a5f22c76dafb6b25c08d0ceb87252782c0.tar.gz
surf-701815a5f22c76dafb6b25c08d0ceb87252782c0.tar.bz2
surf-701815a5f22c76dafb6b25c08d0ceb87252782c0.zip
Adapt clipboard()
Replace linkhover with target uri and add some comments
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/surf.c b/surf.c
index c84f0c5..5e1aa8d 100644
--- a/surf.c
+++ b/surf.c
@@ -107,7 +107,7 @@ static char *buildfile(const char *path);
static char *buildpath(const char *path);
static gboolean buttonreleased(GtkWidget *w, GdkEventKey *e, Client *c);
static void cleanup(void);
-static void clipboard(Client *c, const Arg *arg);
+static void clipboard(Client *c, const Arg *a);
static WebKitCookieAcceptPolicy cookiepolicy_get(void);
static char cookiepolicy_set(const WebKitCookieAcceptPolicy p);
@@ -362,18 +362,16 @@ runscript(Client *c)
}
void
-clipboard(Client *c, const Arg *arg)
+clipboard(Client *c, const Arg *a)
{
- gboolean paste = *(gboolean *)arg;
-
- if (paste) {
+ if (a->b) { /* load clipboard uri */
gtk_clipboard_request_text(gtk_clipboard_get(
GDK_SELECTION_PRIMARY),
pasteuri, c);
- } else {
+ } else { /* copy uri */
gtk_clipboard_set_text(gtk_clipboard_get(
- GDK_SELECTION_PRIMARY), c->linkhover
- ? c->linkhover : geturi(c), -1);
+ GDK_SELECTION_PRIMARY), c->targeturi
+ ? c->targeturi : geturi(c), -1);
}
}