Destroy the input wayland objects

They are not automatically destroyed by the compositor when the seat
loses them.

Change-Id: I72d45d664948afb4b39f137c91870f21d26dcb4a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Add missing pkg-config package

The hardware integrations needs to pick up the correct include path

Change-Id: I457028803d3a4086bff53be4aa91417c1b293623
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Make the glx backend compile again

Still needs some renaming and verification, but this makes it compile at least

Change-Id: Ifb7fc68e8705f235bf0edf2ae9bb38274b693d3c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix invalid surface mapped signal

Prevents mapped signal of the surface without wayland buffer handle.
When a client became hidden just after it was shown, the surface was
sometimes mapped even though the handle of the back buffer was null.

Change-Id: Idc7d38cd27d0fe29525ba18163b4e43220fce125
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Also link wayland-client, as we use bits from it.

Fixes linking on some toolchains where linkage is a bit more restrictive.

Change-Id: I7ec3f2bde009ce6d2e20e4b500a96d234cdcc301
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
inputdevice: Null check m_data_device

Change-Id: Ibe4184c692775ebac89098e5d332f72280184b58
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix build without xkbcommon

Change-Id: If6f0c5e14cea659a42dc0ba10c05356a5703ba14
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix up brcml-egl buffer swap

There is no need to do attach/damage/commit on the gui thread, doing it
on whatever thread we are (e.g. the render thread of scenegraph) is fine.

There is no need for flushRequests() either which means the entire metacall
can be removed.

Change-Id: Ia2ecf7cacc97787e68a97dc6a02641653e072ed3
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fixup the brcm-egl hardware integrations

Change-Id: I2a25c7d0b5019c30f31cba1f608a8731be6b1f10
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
brcm-egl fix: do not remove previous include dirs

Change-Id: I5fef403fa99fc3ac1181cf0b7e149a5d3337a50d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Don't flushWindowSystemEvents in QWaylandWindow ctor.

tests/auto/gui/kernel/qbackingstore test crashed because the
flush in QWaylandWindow::setWindowState invoked backing store
expose event handling which in turn tried to use related
(not yet created) QWaylandWindow.

Change-Id: Ic9f29cc3433e6e671deb756aebe26530ebc72042
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix pkgconfig for brcm-egl hw integration

Change-Id: I092eaebad40785a68c0c9c22201c9e2d39666ea9
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Send the globals to new listeners

Change-Id: I8d2a74cdc305fb086f3b5c63d0abe4c46c40bbde
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix brcm keys

Did not match the key used in the plugin metadata.

Change-Id: I58cf08c684b33d8d7166a074dbafb4187b010498
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix some typos

Change-Id: I5c734561c0c13192acd9ffd590eb2e8eeb3ca4e1
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix qwindow-compositor with raster surfaces

Using the texture cache is wrong for two reasons:
1) it's a private API
2) we will get new QImages all the time so the caching is effectively useless

The main problem here is that the textures were not deleted which embedded
systems do not really like.

Change-Id: Ia9bafb0df58491f5ceb08ddcd9bf11b7c6137c83
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fixup the iid versions for the plugins

Change-Id: Iac1b8b070d3bf87b29d0be9a2a76fd56e7046f0f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix buffer handling.

The surface now has a distinct back and front buffer. Front means it
is on the screen and being used as a texture. Back means it should be
put to screen in the next updatePaintNode().

For the purpose of QML and GUI-thread properties, the 'back' buffer is
what contains the correct properties as it is what it will eventually
be rendered with. For the purpose of rendering, the front buffer
contains the right texture. If no back buffer is present, then there
was no changes and front buffer applies to both.

The Surface's buffer queue has been updated to only fire damage and
advance once we swap back buffer to front buffer which happens during
updatePaintNode(). The fact that the buffer advancing happens during
sync also means that we are releasing buffers back to the client as
soon as another buffer is ready to be displayed in the compositor.
This is "half a frame" earlier than the current implementation (which
releases after the next swap). We consider this safe because:

 - The compositor has a new buffer to display and does not need the
   old one.

 - If the GPU is not done rasterizing the scanout buffer for the
   previous frame, it should hold a read-lock on the buffer so
   preventing the client from starting a render to it. If this
   assumption fails on any hardware we can make the time of
   buffer-advance optional. Either during "sync" or during "after
   rendering" as it is today, but "after rendering" will not offer any
   guarantee, just more time, resulting in a higher chance of the
   buffers being ready. Aka, without an internal read-lock and no
   fence mechanism, there is no guarantee.

Texture cleanup is now explicit as we have a well defined location to
clean up textures, during updatePaintNode(). This avoids cleanup
issues which previously existed as buffer cleanup was happening on the
GUI thread. Surface and Buffer destruction coming over wayland is
queued up in compositor and handled before the next "sync", when it is
safe to do so.

The change also removes doUpdate, postBuffer and frameSwappedInternal
as these are no longer used. Direct rendering will need to be
considered in a new light with the new buffering scheme, and anyway
needs work.

Change-Id: I2db0385b4b8859f96caba374f3530448178e1473
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Removed directrender/pageflipper codepaths.

Change-Id: I770b79eb21fbc4ac7826cec5c47286dab6c74da5
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Allow resizing the Qt window after the buffers swap

Some EGL implementations resize the EGL buffers after eglSwapBuffers,
so we need to send the geometry change event after the swap, or else
the Qt window size and the physical buffer size will be different to
each other. Do not force this behavior though, but use it only when
the QT_WAYLAND_RESIZE_AFTER_SWAP environment variable is set.

Change-Id: I79e39442b3010c563a81d7c94e747a982e158fc1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>