mirror of
https://github.com/NickHu/sway
synced 2024-12-27 21:58:11 +01:00
c32a507303
See: https://github.com/swaywm/sway/issues/4511 Adds a bool config option `primary_selection`, which explicitly enables/disables the primary selection clipboard. Defaults to enabled. This is implemented as a launch-only option which enables or disables the creation of the `zwp_primary_selection_device_manager_v1` global. Co-authored-by: Tilde Rose <t1lde@protonmail.com>
23 lines
656 B
C
23 lines
656 B
C
#include <string.h>
|
|
#include <strings.h>
|
|
#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);
|
|
}
|