drm: Make sure we read all pending udev events
This commit is contained in:
parent
d216e74cfc
commit
01f7ef35e7
1 changed files with 15 additions and 17 deletions
|
@ -249,24 +249,22 @@ bool DrmBackend::initialize()
|
|||
QSocketNotifier *notifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
|
||||
connect(notifier, &QSocketNotifier::activated, this,
|
||||
[this] {
|
||||
auto device = m_udevMonitor->getDevice();
|
||||
if (!device) {
|
||||
return;
|
||||
}
|
||||
bool drm = false;
|
||||
for (auto gpu : m_gpus) {
|
||||
if (gpu->drmId() == device->sysNum()) {
|
||||
drm = true;
|
||||
break;
|
||||
while (auto device = m_udevMonitor->getDevice()) {
|
||||
bool drm = false;
|
||||
for (auto gpu : m_gpus) {
|
||||
if (gpu->drmId() == device->sysNum()) {
|
||||
drm = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!drm) {
|
||||
return;
|
||||
}
|
||||
if (device->hasProperty("HOTPLUG", "1")) {
|
||||
qCDebug(KWIN_DRM) << "Received hot plug event for monitored drm device";
|
||||
updateOutputs();
|
||||
updateCursor();
|
||||
}
|
||||
}
|
||||
if (!drm) {
|
||||
return;
|
||||
}
|
||||
if (device->hasProperty("HOTPLUG", "1")) {
|
||||
qCDebug(KWIN_DRM) << "Received hot plug event for monitored drm device";
|
||||
updateOutputs();
|
||||
updateCursor();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue