mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 09:44:14 +00:00
ignore monitors that didn't match a rule
Fixes: https://codeberg.org/dwl/dwl/issues/527
This commit is contained in:
parent
43f31b8f1b
commit
dac2987126
8
dwl.c
8
dwl.c
@ -857,6 +857,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||
* monitor) becomes available. */
|
||||
struct wlr_output *wlr_output = data;
|
||||
const MonitorRule *r;
|
||||
int matched = 0;
|
||||
size_t i;
|
||||
Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m));
|
||||
m->wlr_output = wlr_output;
|
||||
@ -869,6 +870,7 @@ createmon(struct wl_listener *listener, void *data)
|
||||
m->tagset[0] = m->tagset[1] = 1;
|
||||
for (r = monrules; r < END(monrules); r++) {
|
||||
if (!r->name || strstr(wlr_output->name, r->name)) {
|
||||
matched = 1;
|
||||
m->mfact = r->mfact;
|
||||
m->nmaster = r->nmaster;
|
||||
wlr_output_set_scale(wlr_output, r->scale);
|
||||
@ -880,6 +882,12 @@ createmon(struct wl_listener *listener, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
fprintf(stderr, "No monrules found for %s, ignoring output\n", wlr_output->name);
|
||||
free(m);
|
||||
return;
|
||||
}
|
||||
|
||||
/* The mode is a tuple of (width, height, refresh rate), and each
|
||||
* monitor supports only a specific set of modes. We just pick the
|
||||
* monitor's preferred mode; a more sophisticated compositor would let
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user