mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-28 02:34:15 +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. */
|
* monitor) becomes available. */
|
||||||
struct wlr_output *wlr_output = data;
|
struct wlr_output *wlr_output = data;
|
||||||
const MonitorRule *r;
|
const MonitorRule *r;
|
||||||
|
int matched = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m));
|
Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m));
|
||||||
m->wlr_output = wlr_output;
|
m->wlr_output = wlr_output;
|
||||||
@ -869,6 +870,7 @@ createmon(struct wl_listener *listener, void *data)
|
|||||||
m->tagset[0] = m->tagset[1] = 1;
|
m->tagset[0] = m->tagset[1] = 1;
|
||||||
for (r = monrules; r < END(monrules); r++) {
|
for (r = monrules; r < END(monrules); r++) {
|
||||||
if (!r->name || strstr(wlr_output->name, r->name)) {
|
if (!r->name || strstr(wlr_output->name, r->name)) {
|
||||||
|
matched = 1;
|
||||||
m->mfact = r->mfact;
|
m->mfact = r->mfact;
|
||||||
m->nmaster = r->nmaster;
|
m->nmaster = r->nmaster;
|
||||||
wlr_output_set_scale(wlr_output, r->scale);
|
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
|
/* 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 supports only a specific set of modes. We just pick the
|
||||||
* monitor's preferred mode; a more sophisticated compositor would let
|
* monitor's preferred mode; a more sophisticated compositor would let
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user