diff options
author | tsxv478 <vt0451@yandex.ru> | 2022-09-27 11:45:48 +0300 |
---|---|---|
committer | tsxv478 <vt0451@yandex.ru> | 2022-09-27 11:45:48 +0300 |
commit | 9b7c59e32d5980856f3e8a066dbf5e84ff61d030 (patch) | |
tree | c47d560e085c77dc1089e4b5b7aa0c620d43be6a | |
parent | c52e6bfc2a9df4ee17d10664e78850f4378629cf (diff) |
clipboard instead of primary
-rw-r--r-- | config.def.h | 1 | ||||
-rw-r--r-- | surf.c | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index a9fed5c..305957d 100644 --- a/config.def.h +++ b/config.def.h @@ -53,6 +53,7 @@ static Parameter defconfig[ParameterLast] = { [Style] = { { .i = 1 }, }, [WebGL] = { { .i = 0 }, }, [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, }; static UriParameters uriparams[] = { @@ -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); } } |