platforms/wayland: Emit outputEnabled() signal

Otherwise the QPA won't create QPlatformScreens and the compositor may
not work as expected.
This commit is contained in:
Vlad Zahorodnii 2021-02-10 12:01:18 +02:00
parent 7c325b7436
commit 2ce49877f7
2 changed files with 15 additions and 3 deletions

View file

@ -474,7 +474,7 @@ WaylandBackend::~WaylandBackend()
delete m_waylandCursor;
m_eventQueue->release();
qDeleteAll(m_outputs);
destroyOutputs();
if (m_xdgShell) {
m_xdgShell->release();
@ -625,8 +625,7 @@ void WaylandBackend::initConnection()
delete m_seat;
m_shm->destroy();
qDeleteAll(m_outputs);
m_outputs.clear();
destroyOutputs();
if (m_xdgShell) {
m_xdgShell->destroy();
@ -730,11 +729,23 @@ void WaylandBackend::createOutputs()
logicalWidthSum += logicalWidth;
m_outputs << waylandOutput;
emit outputAdded(waylandOutput);
emit outputEnabled(waylandOutput);
}
setReady(true);
emit screensQueried();
}
void WaylandBackend::destroyOutputs()
{
while (!m_outputs.isEmpty()) {
WaylandOutput *output = m_outputs.takeLast();
emit outputDisabled(output);
emit outputRemoved(output);
delete output;
}
}
OpenGLBackend *WaylandBackend::createOpenGLBackend()
{
#if HAVE_WAYLAND_EGL

View file

@ -209,6 +209,7 @@ Q_SIGNALS:
private:
void initConnection();
void createOutputs();
void destroyOutputs();
void updateScreenSize(WaylandOutput *output);
void relativeMotionHandler(const QSizeF &delta, const QSizeF &deltaNonAccelerated, quint64 timestamp);