This commit is contained in:
paul-ri 2023-04-09 21:30:29 +02:00 committed by GitHub
commit 69a662fa3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 1 deletions

View file

@ -413,6 +413,8 @@ struct cmd_results *config_command(char *exec, char **new_block) {
&& handler->handle != cmd_bindgesture && handler->handle != cmd_bindgesture
&& handler->handle != cmd_set && handler->handle != cmd_set
&& handler->handle != cmd_for_window && handler->handle != cmd_for_window
&& handler->handle != cmd_output
&& handler->handle != cmd_input
&& (*argv[i] == '\"' || *argv[i] == '\'')) { && (*argv[i] == '\"' || *argv[i] == '\'')) {
strip_quotes(argv[i]); strip_quotes(argv[i]);
} }

View file

@ -53,6 +53,13 @@ struct cmd_results *cmd_input(int argc, char **argv) {
return error; return error;
} }
// Commands from config_command() & execute_command() don't handle quotes the same way
for (int i = 0; i < argc; ++i) {
if (*argv[i] == '\"' || *argv[i] == '\'') {
strip_quotes(argv[i]);
}
}
sway_log(SWAY_DEBUG, "entering input block: %s", argv[0]); sway_log(SWAY_DEBUG, "entering input block: %s", argv[0]);
config->handler_context.input_config = new_input_config(argv[0]); config->handler_context.input_config = new_input_config(argv[0]);

View file

@ -2,6 +2,7 @@
#include "sway/commands.h" #include "sway/commands.h"
#include "sway/config.h" #include "sway/config.h"
#include "sway/output.h" #include "sway/output.h"
#include "stringop.h"
#include "list.h" #include "list.h"
#include "log.h" #include "log.h"
@ -43,6 +44,13 @@ struct cmd_results *cmd_output(int argc, char **argv) {
"Refusing to configure the no op output"); "Refusing to configure the no op output");
} }
// Commands from config_command() & execute_command() don't handle quotes the same way
for (int i = 0; i < argc; ++i) {
if (*argv[i] == '\"' || *argv[i] == '\'') {
strip_quotes(argv[i]);
}
}
struct output_config *output = NULL; struct output_config *output = NULL;
if (strcmp(argv[0], "-") == 0 || strcmp(argv[0], "--") == 0) { if (strcmp(argv[0], "-") == 0 || strcmp(argv[0], "--") == 0) {
if (config->reading) { if (config->reading) {

View file

@ -733,7 +733,7 @@ void apply_output_config_to_outputs(struct output_config *oc) {
wl_list_for_each_safe(sway_output, tmp, &root->all_outputs, link) { wl_list_for_each_safe(sway_output, tmp, &root->all_outputs, link) {
char *name = sway_output->wlr_output->name; char *name = sway_output->wlr_output->name;
output_get_identifier(id, sizeof(id), sway_output); output_get_identifier(id, sizeof(id), sway_output);
if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { if (wildcard || !output_name_cmp(oc, name) || !output_name_cmp(oc, id)) {
struct output_config *current = get_output_config(id, sway_output); struct output_config *current = get_output_config(id, sway_output);
if (!current) { if (!current) {
// No stored output config matched, apply oc directly // No stored output config matched, apply oc directly