session: use deviceID instead of fd for libseat_close_device (#18)

This commit is contained in:
Ikalco 2024-07-16 11:29:09 -05:00 committed by GitHub
parent d6791cc5ce
commit 1e385d02b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,10 +136,11 @@ Aquamarine::CSessionDevice::CSessionDevice(Hyprutils::Memory::CSharedPointer<CSe
} }
Aquamarine::CSessionDevice::~CSessionDevice() { Aquamarine::CSessionDevice::~CSessionDevice() {
if (fd < 0) if (deviceID >= 0)
return; if (libseat_close_device(session->libseatHandle, deviceID) < 0)
libseat_close_device(session->libseatHandle, fd); session->backend->log(AQ_LOG_ERROR, std::format("libseat: Couldn't close device at {}", path));
close(fd); if (fd >= 0)
close(fd);
} }
bool Aquamarine::CSessionDevice::supportsKMS() { bool Aquamarine::CSessionDevice::supportsKMS() {