aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-07 10:15:00 -0500
committerGitHub <noreply@github.com>2017-12-07 10:15:00 -0500
commitf469784bbc73bf6346430a2caa7dc366ad2d0308 (patch)
treed88096760223a2d5e64c7bb5cdb862c1a8532b5f /rootston
parentaead5019a7075a5823ae7e9255106e666e7b87de (diff)
parent91d72040e588c500e8017c6ad824a96ed4180996 (diff)
Merge pull request #469 from emersion/output-config-by-name
Configure outputs with make, model, serial in rootston
Diffstat (limited to 'rootston')
-rw-r--r--rootston/config.c15
-rw-r--r--rootston/output.c2
2 files changed, 11 insertions, 6 deletions
diff --git a/rootston/config.c b/rootston/config.c
index 466ad16a..59adf13c 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -120,7 +120,7 @@ void add_binding_config(struct wl_list *bindings, const char* combination,
xkb_keysym_t keysyms[ROOTS_KEYBOARD_PRESSED_KEYSYMS_CAP];
char *symnames = strdup(combination);
- char* symname = strtok(symnames, "+");
+ char *symname = strtok(symnames, "+");
while (symname) {
uint32_t modifier = parse_modifier(symname);
if (modifier != 0) {
@@ -466,10 +466,15 @@ void roots_config_destroy(struct roots_config *config) {
struct roots_output_config *roots_config_get_output(struct roots_config *config,
struct wlr_output *output) {
- struct roots_output_config *o_config;
- wl_list_for_each(o_config, &config->outputs, link) {
- if (strcmp(o_config->name, output->name) == 0) {
- return o_config;
+ char name[83];
+ snprintf(name, sizeof(name), "%s %s %s", output->make, output->model,
+ output->serial);
+
+ struct roots_output_config *oc;
+ wl_list_for_each(oc, &config->outputs, link) {
+ if (strcmp(oc->name, output->name) == 0 ||
+ strcmp(oc->name, name) == 0) {
+ return oc;
}
}
diff --git a/rootston/output.c b/rootston/output.c
index d0f4a378..aace1991 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -291,7 +291,7 @@ void output_add_notify(struct wl_listener *listener, void *data) {
struct roots_config *config = desktop->config;
wlr_log(L_DEBUG, "Output '%s' added", wlr_output->name);
- wlr_log(L_DEBUG, "%s %s %s %"PRId32"mm x %"PRId32"mm", wlr_output->make,
+ wlr_log(L_DEBUG, "'%s %s %s' %"PRId32"mm x %"PRId32"mm", wlr_output->make,
wlr_output->model, wlr_output->serial, wlr_output->phys_width,
wlr_output->phys_height);
if (wl_list_length(&wlr_output->modes) > 0) {