From 9b7c59e32d5980856f3e8a066dbf5e84ff61d030 Mon Sep 17 00:00:00 2001 From: tsxv478 Date: Tue, 27 Sep 2022 11:45:48 +0300 Subject: clipboard instead of primary --- surf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'surf.c') diff --git a/surf.c b/surf.c index 2c67a2e..6f5ba5b 100644 --- a/surf.c +++ b/surf.c @@ -84,6 +84,7 @@ typedef enum { Style, WebGL, ZoomLevel, + ClipboardNotPrimary, ParameterLast } ParamName; @@ -301,6 +302,7 @@ static ParamName loadcommitted[] = { SpellLanguages, Style, ZoomLevel, + ClipboardNotPrimary, ParameterLast }; @@ -1863,13 +1865,18 @@ showcert(Client *c, const Arg *a) void clipboard(Client *c, const Arg *a) { + /* User defined choice of selection, see config.h */ + GdkAtom selection = GDK_SELECTION_PRIMARY; + if (curconfig[ClipboardNotPrimary].val.i > 0) + selection = GDK_SELECTION_CLIPBOARD; + if (a->i) { /* load clipboard uri */ gtk_clipboard_request_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), + selection), pasteuri, c); } else { /* copy uri */ gtk_clipboard_set_text(gtk_clipboard_get( - GDK_SELECTION_PRIMARY), c->targeturi + selection), c->targeturi ? c->targeturi : geturi(c), -1); } } -- cgit v1.2.3