From 1c07868f2fddf2e959e615a8302b3a61b3625003 Mon Sep 17 00:00:00 2001
From: Violet Purcell <vimproved@inventati.org>
Date: Sat, 3 Feb 2024 12:12:37 -0500
Subject: [PATCH] sway/config.c: only reset primary_selection at launch

Otherwise, an error will be shown whenever reloading due to the value of
primary_selection being reset to true.

(cherry picked from commit 6b2aa8324681b2623f660c3851397761df9b70dc)
---
 sway/config.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sway/config.c b/sway/config.c
index 4b51dc73..099e0e81 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -475,6 +475,11 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
 				old_config->xwayland ? "enabled" : "disabled");
 		config->xwayland = old_config->xwayland;
 
+		// primary_selection can only be enabled/disabled at launch
+		sway_log(SWAY_DEBUG, "primary_selection will remain %s",
+				old_config->primary_selection ? "enabled" : "disabled");
+		config->primary_selection = old_config->primary_selection;
+
 		if (!config->validating) {
 			if (old_config->swaybg_client != NULL) {
 				wl_client_destroy(old_config->swaybg_client);