summaryrefslogtreecommitdiffstats
path: root/examples/wayland/qwindow-compositor
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-10-28 09:44:08 +0100
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-10-28 09:02:42 +0000
commitca0bc644dc7b338a06f58465d9d31950052acf54 (patch)
tree35b63053a7f5ce93726e840bf9e9827349730f54 /examples/wayland/qwindow-compositor
parent699c44e3dc2d7099fdd87060c39309e318c55616 (diff)
Workaround for qwindow-compositor on platforms other than xcb
Creating the QWaylandOutput after the compositor's create() posts an event to the output object and defers initialization. This is fragile since there is nothing guaranteeing the application will not get to render in the meantime and not start calling functions like defaultOutput(), which all return null since there are 0 outputs registered at that time due to the deferred QWaylandOutput::initialize(). Until the issue gets solved by redesigning the behavior somehow, swap the two lines to get qwindow-compositor running with eglfs. This way the output's initialize() is called directly from the compositor's create() and this all output-related functions are usable afterwards immediately. Change-Id: Ie4203d0a4d0ec35804ef8c320121750f02b50724 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'examples/wayland/qwindow-compositor')
-rw-r--r--examples/wayland/qwindow-compositor/windowcompositor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/wayland/qwindow-compositor/windowcompositor.cpp b/examples/wayland/qwindow-compositor/windowcompositor.cpp
index a359fc6b3..b55975623 100644
--- a/examples/wayland/qwindow-compositor/windowcompositor.cpp
+++ b/examples/wayland/qwindow-compositor/windowcompositor.cpp
@@ -82,8 +82,8 @@ WindowCompositor::~WindowCompositor()
void WindowCompositor::create()
{
- QWaylandCompositor::create();
new QWaylandOutput(this, m_window);
+ QWaylandCompositor::create();
connect(this, &QWaylandCompositor::surfaceCreated, this, &WindowCompositor::onSurfaceCreated);
connect(defaultInputDevice(), &QWaylandInputDevice::cursorSurfaceRequest, this, &WindowCompositor::adjustCursorSurface);