don't add existing and invalid monitors
This commit is contained in:
parent
f5645805d8
commit
b76b32b458
3 changed files with 21 additions and 0 deletions
|
|
@ -48,6 +48,16 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
|
|||
// new monitor added, let's accomodate for that.
|
||||
const auto OUTPUT = (wlr_output*)data;
|
||||
|
||||
if (!OUTPUT->name) {
|
||||
Debug::log(ERR, "New monitor has no name?? Ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_pCompositor->getMonitorFromName(std::string(OUTPUT->name))) {
|
||||
Debug::log(WARN, "Monitor with name %s already exists, not adding as new!", OUTPUT->name);
|
||||
return;
|
||||
}
|
||||
|
||||
// get monitor rule that matches
|
||||
SMonitorRule monitorRule = g_pConfigManager->getMonitorRuleFor(OUTPUT->name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue