Fix return type conflict with libhybris

The return type in 'PFNEGLHYBRISGETNATIVEBUFFERINFOPROC' and
'PFNEGLHYBRISSERIALIZENATIVEBUFFERPROC' conflict with hybris_native.h,
it is void while it should be EGLBoolean.

Change-Id: Ia23ab4da59b3a904eb5b2884398ab5dd207f415b
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Yen-Chin Lee <coldnew.tw@gmail.com>
Support RasterGLSurface windows

In an attempt to make QOpenGLWidget and QQuickWidget working on Wayland.

Since Qt 5.3 all widget windows are of type RasterGLSurface (given that
the plugin reports this capability which wayland will, with this patch).
Such a window can behave either like a raster or an OpenGL window.

This concept maps badly to platform plugins that have a rigid separation
between raster and OpenGL platform window implementations. From now on,
the OpenGL window implementation, that is used pretty much always,
except for raw RasterSurface windows, must be prepared to behave like
a raster window too, which involves having a backingstore.

Change-Id: I0226704b8d5893843fcae68059c5fe9ad2f5e761
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Indicate from the client buffer integration if decorations are supported

Custom client buffer integrations may not care about window decorations.
Setting QT_WAYLAND_DISABLE_WINDOWDECORATION is tedious and error-prone.
And it cannot be omitted since things like input events will be off if the
common client code thinks decorations are in use but the client buffer
integration does not render them at all.

Therefore add a supportsWindowDecoration() virtual in addition to the
environment variable.

Change-Id: If8f621182d5c230f4d8d679c050f5d27aed6c2fb
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Returns false for window decoration support in xcomposite and brcm

Change-Id: Ibc8eae85219da044812d22967c46b4bebb5e27bf
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Remove the unused context parameter from lock/unlock

Nothing relies on it and we are anyway passing null.

Change-Id: I2543650441c7f97d23b52bc7a4caa555b0777676
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
build: If building the compositor API, build plugins after the compositor library.

Some plugins require the compositor library, so it must be finished first.

Change-Id: I60d2932cdd0e777a0ad0dd866246c59b9a1f47fc
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Warn when EGLContext could not be created.

Change-Id: Id840ace3d762e47c0076745301e8012755077770
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
qwindow-compositor: Rename QOpenGLWindow

That's a public class in Qt 5.4. Use the more appropriate CompositorWindow.

Change-Id: Id7de20c7e2d5b373f8ef9fe9a836188dc864479e
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Fix touch with Weston

Work around the missing touch_frame after the last touch_up.

Task-number: QTBUG-36602
Change-Id: Iccb03bdc8b430c7cefc097c3c84e50be676c7fe7
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Wayland: correct touch location

The window margins were offsetting the touch point in the wrong
direction.

Task-number: QTBUG-36602
Change-Id: Id8b31d2de4051f36d3ff4e088bbc9bd7cc84ca13
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Wayland: can drag a window by its titlebar using the touchscreen

It was already possible to drag it via the mouse but not via touch.

Task-number: QTBUG-41085
Change-Id: Ia52c7124fb2f1aa0331897bd072fcf09fb78aa1a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix crash of test client

No wl_data_device_manager created in Mock compositor

Change-Id: If80f71165c28678f296bc18f0fea572dcb1a2f77
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Destroy the QScreen when its wl_output is removed

Change-Id: I4532d05cca44c88fe38c14eacbe90c190f272b2c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
DataOffer not invalidated when client loses keyboard focus

The data_offer object should be invalidated when client loses keyboard focus.
Otherwise in following scenario, it will become zombie object: start app1 ->
copy text -> start app2 -> paste text -> close app1 -> paste again in app2 ->
seg fault in qtwayland.

The root cause is that when app2 takes focus the first time, data_device.data_offer
event was sent to it from DataDevice::setFocus. When app1 is closed, the data source
reference in data offer becomes invalid. so when trying to paste again in app2,
segmentation faults

Change-Id: I16a584e80fddaadd269b00cdf39eb405dd95b622
Task-number: QTBUG-41005
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Fix warning from qmake in the compositor headers

Change-Id: I3a23a8af2f3e7f5ac5f1fcabc8e678de39558f61
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Avoid unused parameter

Change-Id: Icfc7e4e2d6cd030fc0509ad4724b577f88c4e850
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Advertise new screens created after startup

Change-Id: I995f49e52ec888830b478f1e1f9cc82132776725
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix window decorations for GL apps

You cannot have rounded corners with an alpha-less config. To make OpenGL
applications appearing with the correct decoration, alpha must be enabled.

With this fix the OpenGL apps' decoration will now look identical to the
SHM apps'.

Change-Id: I24431ddab63146f7f697c85277f00f41e5c55e85
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Allow activating decoration buttons with touch

Task-number: QTBUG-41142
Change-Id: Ifad600d375d3b5ba197c384ece54a93db9aa0d2d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Avoid useless handleTouchEvent call

The call when allReleased is true is a historical artifact: Originally
the call was necessary to generate a TouchEnd. Later the determination
of the event type got moved to QWindowSystemInterface. As a result the
call is completely superfluous since it will bail out immediately.

Task-number: QTBUG-36473
Change-Id: If1a270445a620e6f795912873c60fb1a05384964
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>