aboutsummaryrefslogtreecommitdiff
path: root/selection.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-23 09:44:45 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-23 09:44:45 +0000
commite7b8f95af77d30c98c44f0fb0fd93285d8ca385b (patch)
tree195d14f2993b7d09231d614e60c22b3501d32dd7 /selection.c
parentMerge branch 'mouse-button-encoding-of-button-6-7' (diff)
parentconfig: selection-target: space-optimize the static ‘value’ array (diff)
Merge branch 'selection-to-clipboard'
Closes #288
Diffstat (limited to 'selection.c')
-rw-r--r--selection.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/selection.c b/selection.c
index 966b6b2a..00292541 100644
--- a/selection.c
+++ b/selection.c
@@ -1017,7 +1017,23 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial)
}
xassert(term->selection.start.row <= term->selection.end.row);
- selection_to_primary(seat, term, serial);
+
+ switch (term->conf->selection_target) {
+ case SELECTION_TARGET_NONE:
+ break;
+
+ case SELECTION_TARGET_PRIMARY:
+ selection_to_primary(seat, term, serial);
+ break;
+ case SELECTION_TARGET_CLIPBOARD:
+ selection_to_clipboard(seat, term, serial);
+ break;
+
+ case SELECTION_TARGET_BOTH:
+ selection_to_primary(seat, term, serial);
+ selection_to_clipboard(seat, term, serial);
+ break;
+ }
}
void