plugins/x11: Emit outputAdded and outputRemoved
Currently, these two signals are emitted primarily only on Wayland, but in order to have consistent core API, it's better to emit them on X11 too.
This commit is contained in:
parent
389407805c
commit
2d5482b013
2 changed files with 9 additions and 2 deletions
|
@ -431,13 +431,17 @@ void X11StandalonePlatform::doUpdateOutputs()
|
|||
o->setRefreshRate(60000);
|
||||
o->setName(QStringLiteral("Xinerama"));
|
||||
m_outputs << o;
|
||||
emit outputAdded(o);
|
||||
};
|
||||
|
||||
// TODO: instead of resetting all outputs, check if new output is added/removed
|
||||
// or still available and leave still available outputs in m_outputs
|
||||
// untouched (like in DRM backend)
|
||||
qDeleteAll(m_outputs);
|
||||
m_outputs.clear();
|
||||
while (!m_outputs.isEmpty()) {
|
||||
X11Output *output = m_outputs.takeLast();
|
||||
emit outputRemoved(output);
|
||||
delete output;
|
||||
}
|
||||
|
||||
if (!Xcb::Extensions::self()->isRandrAvailable()) {
|
||||
fallback();
|
||||
|
@ -523,6 +527,7 @@ void X11StandalonePlatform::doUpdateOutputs()
|
|||
}
|
||||
|
||||
m_outputs << o;
|
||||
emit outputAdded(o);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -177,6 +177,7 @@ void X11WindowedBackend::createOutputs()
|
|||
|
||||
logicalWidthSum += logicalWidth;
|
||||
m_outputs << output;
|
||||
emit outputAdded(output);
|
||||
}
|
||||
|
||||
updateWindowTitle();
|
||||
|
@ -381,6 +382,7 @@ void X11WindowedBackend::handleClientMessage(xcb_client_message_event_t *event)
|
|||
x += (*it)->geometry().width();
|
||||
}
|
||||
|
||||
emit outputRemoved(removedOutput);
|
||||
delete removedOutput;
|
||||
QMetaObject::invokeMethod(screens(), "updateCount");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue