qtwayland コンポジター テストで奇妙な問題が発生しました。qt c++ クライアントでのみ機能するようです。Qml クライアントがデッドロックで終了し、イベント処理が停止します (クライアントの場合)。このhttps://doc.qt.io/archives/qt-5.11/qtwaylandcompositor-qwindow-compositor-example.htmlの例を変更し、次の機能を追加しました。
void Compositor::onSurfaceCreated(QWaylandSurface *surface)
{
connect(surface, &QWaylandSurface::subsurfacePositionChanged, this, &WaylandInterface::onSubsurfacePositionChanged);
QQuickWindow *window = new QQuickWindow();
window->resize( 400, 400);
window->setVisible(true);
QWaylandOutput* output = new QWaylandOutput( this, window );
QCoreApplication::processEvents();
View *view = new View(this);
view->setSurface(surface);
view->setOutput(output);
view->m_window = window;
m_views << view;
connect(surface, &QWaylandSurface::surfaceDestroyed, view, [view] {
view->m_window->requestUpdate();
} );
connect(surface, &QWaylandSurface::hasContentChanged, this, &WaylandInterface::surfaceHasContentChanged);
connect(surface, &QWaylandSurface::hasContentChanged, view, [view] {
view->m_window->requestUpdate();
} );
connect(surface, &QWaylandSurface::redraw, view, [view] {
view->m_window->requestUpdate();
} );
QWaylandQuickItem * surfacItem = new QWaylandQuickItem( view->m_window->contentItem() );
surfacItem->setSurface( surface );
surfacItem->setOutput( view->output() );
surfacItem->setPaintEnabled(true);
surfacItem->setInputEventsEnabled(true);
connect(surface, &QWaylandSurface::offsetForNextFrame, view, &View::onOffsetForNextFrame);
connect(view, &QWaylandView::surfaceDestroyed, this, &WaylandInterface::viewSurfaceDestroyed);
}
c++ クライアントの場合、ウィンドウを作成してクライアントを埋め込みますが、qml クライアントは応答しません。ウィンドウ、出力、QuickItem の作成順序は正しいですか? 私は何かが恋しいですか?
ありがとう、ケイン