From fb86ed6b0588dfdebfb66ce875bc63cfa0a897f6 Mon Sep 17 00:00:00 2001 From: Reza Jelveh Date: Mon, 15 Apr 2024 13:39:41 +0800 Subject: feat: 1.9 merge (#277) Co-authored-by: William McKinnon Co-authored-by: Erik Reider <35975961+ErikReider@users.noreply.github.com> --- sway/commands/primary_selection.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 sway/commands/primary_selection.c (limited to 'sway/commands/primary_selection.c') diff --git a/sway/commands/primary_selection.c b/sway/commands/primary_selection.c new file mode 100644 index 00000000..585b079d --- /dev/null +++ b/sway/commands/primary_selection.c @@ -0,0 +1,23 @@ +#include +#include +#include "sway/config.h" +#include "sway/commands.h" +#include "util.h" + +struct cmd_results *cmd_primary_selection(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "primary_selection", EXPECTED_EQUAL_TO, 1))) { + return error; + } + + bool primary_selection = parse_boolean(argv[0], true); + + if (config->reloading && config->primary_selection != primary_selection) { + return cmd_results_new(CMD_FAILURE, + "primary_selection can only be enabled/disabled at launch"); + } + + config->primary_selection = parse_boolean(argv[0], true); + + return cmd_results_new(CMD_SUCCESS, NULL); +} -- cgit v1.2.3