Add primary_selection config option

See: https://github.com/swaywm/sway/issues/4511

Adds a config option 'primary_selection', which explicitly
enables/disables the primary selection clipboard.

This is implemented as a config-option check in 'handle_request_set_primary_selection', which clears
the primary selection if the option is set to 'disabled'.
This commit is contained in:
Tilde Rose 2022-03-16 22:22:41 +00:00
parent 440d0bc22d
commit 6d5a42ff92
8 changed files with 42 additions and 1 deletions

View file

@ -164,6 +164,7 @@ sway_cmd cmd_no_focus;
sway_cmd cmd_output;
sway_cmd cmd_permit;
sway_cmd cmd_popup_during_fullscreen;
sway_cmd cmd_primary_selection;
sway_cmd cmd_reject;
sway_cmd cmd_reload;
sway_cmd cmd_rename;

View file

@ -130,6 +130,7 @@ struct input_config_tool {
enum sway_tablet_tool_mode mode;
};
/**
* options for input devices
*/
@ -468,6 +469,12 @@ enum xwayland_mode {
XWAYLAND_MODE_IMMEDIATE,
};
enum config_primary_selection {
PRIMARY_SELECTION_DEFAULT,
PRIMARY_SELECTION_DISABLED,
PRIMARY_SELECTION_ENABLED,
};
/**
* The configuration struct. The result of loading a config file.
*/
@ -527,6 +534,7 @@ struct sway_config {
bool auto_back_and_forth;
bool show_marks;
enum alignment title_align;
enum config_primary_selection primary_selection;
bool tiling_drag;
int tiling_drag_threshold;