surf

A surf web browser [kocotian build]
git clone git://git.kocotian.pl/surf.git
Log | Files | Refs | README | LICENSE

commit 36d31e6d9ecbb6bbf4d78558ecdd59768a822c3d
parent b10a665f81ce74a7ac947ad1c65cc71920cfcaef
Author: kocotian <kocotian@kocotian.pl>
Date:   Tue, 22 Dec 2020 18:13:30 +0100

primary -> clipboard

Diffstat:
Mconfig.def.h | 1+
Cconfig.def.h -> config.def.h.orig | 0
Mpatches/surf-clipboard-20200112-a6a8878.diff | 0
Msurf.c | 11+++++++++--
Csurf.c -> surf.c.orig | 0
5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -67,6 +67,7 @@ static Parameter defconfig[ParameterLast] = { [Style] = { { .i = 1 }, }, [WebGL] = { { .i = 0 }, }, [ZoomLevel] = { { .f = 1.0 }, }, + [ClipboardNotPrimary] = { { .i = 1 }, }, }; static UriParameters uriparams[] = { diff --git a/config.def.h b/config.def.h.orig diff --git a/patches/surf-clipboard-20200112-a6a8878.diff b/patches/surf-clipboard-20200112-a6a8878.diff diff --git a/surf.c b/surf.c @@ -85,6 +85,7 @@ typedef enum { Style, WebGL, ZoomLevel, + ClipboardNotPrimary, ParameterLast } ParamName; @@ -302,6 +303,7 @@ static ParamName loadcommitted[] = { SpellLanguages, Style, ZoomLevel, + ClipboardNotPrimary, ParameterLast }; @@ -1900,13 +1902,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); } } diff --git a/surf.c b/surf.c.orig