drm: ensure disconnect called for removed connectors (#215)

Originally disconnected monitors were not removed from hyprland
correctly and duplications were created when an external monitor was
reattached leading to invalid behavior when switching
(empty desktop is visible).

Now removed monitors are explicitly disconnected during connectors
scanning.
This commit is contained in:
jaro 2025-10-07 11:44:35 +00:00 committed by GitHub
parent 81a0ddf42f
commit 3b3d8a8bde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -847,12 +847,12 @@ void Aquamarine::CDRMBackend::scanConnectors() {
}
// cleanup hot unplugged connectors
std::erase_if(connectors, [resources](const auto& conn) {
std::erase_if(connectors, [resources](auto& conn) {
for (int i = 0; i < resources->count_connectors; ++i) {
if (resources->connectors[i] == conn->id)
return false;
}
conn->disconnect();
return true;
});