qt:qtwayland.git
3 years agoAllow activating decoration buttons with touch v5.4.0-alpha1
Laszlo Agocs [Sat, 6 Sep 2014 19:44:18 +0000 (21:44 +0200)]
Allow activating decoration buttons with touch

Task-number: QTBUG-41142
Change-Id: Ifad600d375d3b5ba197c384ece54a93db9aa0d2d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix window decorations for GL apps
Laszlo Agocs [Fri, 5 Sep 2014 11:46:56 +0000 (13:46 +0200)]
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>
3 years agoAdvertise new screens created after startup
Giulio Camuffo [Sat, 6 Sep 2014 14:15:00 +0000 (17:15 +0300)]
Advertise new screens created after startup

Change-Id: I995f49e52ec888830b478f1e1f9cc82132776725
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoAvoid unused parameter
Laszlo Agocs [Fri, 5 Sep 2014 15:01:56 +0000 (17:01 +0200)]
Avoid unused parameter

Change-Id: Icfc7e4e2d6cd030fc0509ad4724b577f88c4e850
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix warning from qmake in the compositor headers
Laszlo Agocs [Fri, 5 Sep 2014 09:02:46 +0000 (11:02 +0200)]
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>
3 years agoDataOffer not invalidated when client loses keyboard focus
Li Qiu [Wed, 27 Aug 2014 15:24:52 +0000 (18:24 +0300)]
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>
3 years agoDestroy the QScreen when its wl_output is removed
Giulio Camuffo [Wed, 3 Sep 2014 20:16:27 +0000 (23:16 +0300)]
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>
3 years agoFix crash of test client
Li Qiu [Tue, 2 Sep 2014 14:25:39 +0000 (17:25 +0300)]
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>
3 years agoWayland: can drag a window by its titlebar using the touchscreen
Shawn Rutledge [Mon, 1 Sep 2014 15:04:09 +0000 (17:04 +0200)]
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>
3 years agoWayland: correct touch location
Shawn Rutledge [Mon, 1 Sep 2014 13:30:42 +0000 (15:30 +0200)]
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>
3 years agoFix touch with Weston
Laszlo Agocs [Fri, 29 Aug 2014 18:43:20 +0000 (20:43 +0200)]
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>
3 years agoqwindow-compositor: Rename QOpenGLWindow
Laszlo Agocs [Fri, 29 Aug 2014 13:19:45 +0000 (15:19 +0200)]
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>
3 years agoWarn when EGLContext could not be created.
Gunnar Sletta [Fri, 29 Aug 2014 09:31:53 +0000 (09:31 +0000)]
Warn when EGLContext could not be created.

Change-Id: Id840ace3d762e47c0076745301e8012755077770
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agobuild: If building the compositor API, build plugins after the compositor library.
Robin Burchell [Tue, 26 Aug 2014 10:23:43 +0000 (12:23 +0200)]
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>
3 years agoRemove the unused context parameter from lock/unlock
Laszlo Agocs [Mon, 25 Aug 2014 13:33:17 +0000 (15:33 +0200)]
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>
3 years agoReturns false for window decoration support in xcomposite and brcm
Laszlo Agocs [Mon, 25 Aug 2014 11:17:30 +0000 (13:17 +0200)]
Returns false for window decoration support in xcomposite and brcm

Change-Id: Ibc8eae85219da044812d22967c46b4bebb5e27bf
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoIndicate from the client buffer integration if decorations are supported
Laszlo Agocs [Sat, 23 Aug 2014 13:12:24 +0000 (15:12 +0200)]
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>
3 years agoSupport RasterGLSurface windows
Laszlo Agocs [Fri, 22 Aug 2014 10:41:42 +0000 (12:41 +0200)]
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>
3 years agoFix return type conflict with libhybris
Yen-Chin Lee [Mon, 25 Aug 2014 08:47:03 +0000 (16:47 +0800)]
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>
3 years agoFix build with desktop OpenGL
Giulio Camuffo [Sat, 23 Aug 2014 16:19:50 +0000 (19:19 +0300)]
Fix build with desktop OpenGL

Change-Id: I6a21f447f31e9eeeafed81275c33b0c2c79e1c8a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoExplicitly define the interface versions
Giulio Camuffo [Sat, 23 Aug 2014 17:00:03 +0000 (20:00 +0300)]
Explicitly define the interface versions

Currently a global is bound with the version the interface has in the xml
file. This is a problem for apps that explicitly link to libwayland-client
because they may link to a newer libwayland, so the version of some interface
may be higher than the one that it is actually implemented.

Change-Id: Id0dbe6c0f1e05fe91954b9d8d9472d42d2053cdc
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agocompositor: Do not access members after deleting an instance
Laszlo Agocs [Sat, 23 Aug 2014 12:12:47 +0000 (14:12 +0200)]
compositor: Do not access members after deleting an instance

Change-Id: I4edb73d0b4476492db8e6993e06cd6402cd55180
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix typo
Laszlo Agocs [Fri, 22 Aug 2014 15:04:04 +0000 (17:04 +0200)]
Fix typo

Change-Id: Idd4351b2650e8869d0e6038d11be5da37f4bdbb1
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoDo not crash when querying transientParent() and there's none
Laszlo Agocs [Fri, 22 Aug 2014 12:59:30 +0000 (14:59 +0200)]
Do not crash when querying transientParent() and there's none

Change-Id: I47cddffd7859df2548dacb6aee13beb15a222451
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoSave and restore the state when doing decorations
Laszlo Agocs [Thu, 21 Aug 2014 11:57:33 +0000 (13:57 +0200)]
Save and restore the state when doing decorations

The idea that swapBuffers() randomly changes the state is ridiculous and
breaks even Qt's own OpenGL examples. An application, that has full control
over its context and rendering, is not necessarily prepared for random state
changes in its context.

To overcome this, save and restore all the interesting state. This is fragile
and applications can break it in different ways by setting all sorts of
exotic state, esp. when using modern OpenGL. For GLES2 level stuff it should
be sufficient, though.

Change-Id: I52e7ba4072b241eb92f5f04b81d707ad5bc68f6d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoQWlSurface: Remove unused static.
Robin Burchell [Wed, 20 Aug 2014 20:41:54 +0000 (22:41 +0200)]
QWlSurface: Remove unused static.

This went away in the buffer queue removal in
666f597ccd2ced23ecc71ba497981d1a88c34d77.

Change-Id: I9706f52026eb10e4ec17290262dfbfe52c14719f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWindowCompositor: Prevent double delete.
Robin Burchell [Thu, 21 Aug 2014 11:45:34 +0000 (13:45 +0200)]
QWindowCompositor: Prevent double delete.

With a SHM client, if a null attach happened, then the old buffer would be
deleted but left with a dangling pointer which would be deleted again on the
destructor.

This was revealed by tst_dialog.

Change-Id: I89e22487e7ec982789a4b7dfd45e5db7db3222d1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoDo not request the highest color buffer size
Laszlo Agocs [Thu, 21 Aug 2014 09:56:33 +0000 (11:56 +0200)]
Do not request the highest color buffer size

That third parameter is dangerous and should never be set to true,
unless you know what you are doing. eglfs does not set this flag either.
Do the same in wayland-egl, otherwise certain context/window creation
patterns (in particular with QOffscrenSurface, which is often created with
an existing context's format()) will end up with incompatible contexts
and surfaces on systems that offer both 565 and 888 configs.

Long story short, setting the flag ignores the extra check in the EGL config
selection logic that ensures that you get a config you asked for, i.e. that
a 888 config will not be returned (unless there is no other choice) if 565
was explicitly requested in the input QSurfaceFormat.

The result is that we may get a 888 config even when explicitly asking for 565.
However asking for unspecified will give 565. In the QOffscreenSurface case
this means having an 565 context and a 888 window -> bad match.

Not setting the flag brings the expected behavior: not specifying the color buffer
sizes chooses the lower buffer size (565), explicitly specifying 565 chooses 565,
while explicitly specifying 888 prioritizes 888 configs.

Change-Id: Ia78086a9f255f2933cda7de4f5787d71d58a1356
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix window decorations being leaked.
Robin Burchell [Wed, 20 Aug 2014 19:33:55 +0000 (21:33 +0200)]
Fix window decorations being leaked.

Change-Id: If0483f5e81a033b275ddc14eb1e44ff82fa1ce65
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandDecoration: Remove some unused members
Robin Burchell [Wed, 20 Aug 2014 13:51:04 +0000 (15:51 +0200)]
QWaylandDecoration: Remove some unused members

Change-Id: Ia98190adbd3f710de6734c10062792ce3f4547d9
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoParallelize the QtWayland build.
Robin Burchell [Wed, 20 Aug 2014 21:50:48 +0000 (23:50 +0200)]
Parallelize the QtWayland build.

Remove CONFIG += ordered and specify explicit dependencies to allow the
Compositor and Client modules to be built in parallel.

Change-Id: Ifc7ccbdb6fe6623609ad050ede1cbc995499e524
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
3 years agoAvoid allocating and (failing to) manage our own texture cache
Gunnar Sletta [Wed, 20 Aug 2014 13:03:56 +0000 (15:03 +0200)]
Avoid allocating and (failing to) manage our own texture cache

There is no reason we should be allocating and managing our own set of
window decorations. This is only going to add to the total texture
memory used and because it is managed as a shared GL resource, it
would have needed some care during cleanup to clean it up correctly.

Change-Id: I19651837da6b3dfde0f78a964982f3f67e577493
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoReplace custom texture upload with QOpenGLTexture
Robin Burchell [Tue, 19 Aug 2014 22:37:57 +0000 (00:37 +0200)]
Replace custom texture upload with QOpenGLTexture

Change-Id: Ibf6facdd1fba72c2f9741e49cf2c83f9b4136ffc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoQWindowCompositor: Getting popups to appear in the right place.
Robin Burchell [Tue, 19 Aug 2014 22:58:45 +0000 (00:58 +0200)]
QWindowCompositor: Getting popups to appear in the right place.

Change-Id: I6ba4731abbf892f8f7bb0a0d5b30bba8082e67be
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandDisplay: Centralize error handling in one place.
Robin Burchell [Tue, 19 Aug 2014 16:40:19 +0000 (18:40 +0200)]
QWaylandDisplay: Centralize error handling in one place.

Change-Id: Ifba23e349a4006cea501480a7230408f0fafd1b7
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandDisplay: Correctly intercept all errors when dispatching.
Robin Burchell [Tue, 19 Aug 2014 16:24:56 +0000 (18:24 +0200)]
QWaylandDisplay: Correctly intercept all errors when dispatching.

A connection reset isn't the only form of error we may run into, so make sure we
check for other exceptional circumstances through wl_display_get_error.

This fixes my case of e.g. wl_drm throwing an error but QtWayland never
quitting the client.

Change-Id: I8c76dd7913640e58d03bd2fe52eb054a4daa0235
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoMake the test client more robust and make valgrind happy
Giulio Camuffo [Tue, 19 Aug 2014 13:19:12 +0000 (16:19 +0300)]
Make the test client more robust and make valgrind happy

Change-Id: I39ce667123391b946711cc2d16d12799e8b7dd2d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoReplace signals with Q_SIGNALS.
Robin Burchell [Tue, 19 Aug 2014 13:25:03 +0000 (15:25 +0200)]
Replace signals with Q_SIGNALS.

Fixes tst_headers on QtWayland.

Change-Id: I14ba4a58c257d03d10c63f0413460e2bf52793fc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
3 years agoPartially revert "Error out if dependencies aren't met."
Robin Burchell [Tue, 19 Aug 2014 09:37:10 +0000 (11:37 +0200)]
Partially revert "Error out if dependencies aren't met."

This breaks building from qt.pro in qt5.git when doing integration for the whole
of Qt on CI nodes that don't have wayland installed.

This isn't an optimal solution of course, but it's pragmatic. Maybe it can be
revisited if/when per-module configures are ever a thing.

We reword the warnings to make it clear that QtWayland will not be built under
these circumstances.

This partially reverts commit 5b740c6246e092bc49b029bb7b12b614c4d0ce1e.

Change-Id: I07bd95a3a0349ad37a9025cdf5fd870c348d3799
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
3 years agoCompile with protected visibility
Thiago Macieira [Sun, 29 Jan 2012 11:58:45 +0000 (12:58 +0100)]
Compile with protected visibility

Change-Id: I64fc922122e407487083c86d2a9617beea32507b
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix warning about use of uninitialized variable
Thiago Macieira [Sat, 16 Aug 2014 19:48:38 +0000 (12:48 -0700)]
Fix warning about use of uninitialized variable

qwaylandwindow.cpp:443:25: warning: ‘transform’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: Ic0a96cfda35d331c9957a527eea7f8b987191b5f
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agowayland-egl: Logging cleanup.
Robin Burchell [Sun, 17 Aug 2014 11:51:15 +0000 (13:51 +0200)]
wayland-egl: Logging cleanup.

Prefix warnings with QtCompositor so it's clear where they are coming from.
Remove trailing newlines from messages, they aren't needed.
Also, only warn if something actually goes wrong.

Change-Id: I88b8b03480d938a08a84a4964108d10d86606be6
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandCompositor: Warn if there are still destroyed surfaces on destruction.
Robin Burchell [Sun, 17 Aug 2014 15:17:14 +0000 (17:17 +0200)]
QWaylandCompositor: Warn if there are still destroyed surfaces on destruction.

This means there will be no spurious warning on a well written compositor that
cannot be avoided.

Change-Id: Id4405ffe7ba080096547346c0092bedf28a3b196
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandScreen: Also call QPlatformScreen constructor.
Robin Burchell [Sun, 17 Aug 2014 14:08:45 +0000 (16:08 +0200)]
QWaylandScreen: Also call QPlatformScreen constructor.

Change-Id: Iae63ea5b15f2422ea28f2f9c8d7abeb30d23c86f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandDisplay: Destroy screens when destroying the display.
Robin Burchell [Sun, 17 Aug 2014 14:07:47 +0000 (16:07 +0200)]
QWaylandDisplay: Destroy screens when destroying the display.

Fixes a crash in tst_QApplication.

Change-Id: Ibfc7aded10609cff9c7a20b7193f44d1c73bc893
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoQWaylandDisplay: Remove unused static.
Robin Burchell [Sun, 17 Aug 2014 14:07:21 +0000 (16:07 +0200)]
QWaylandDisplay: Remove unused static.

Change-Id: I868168dee716103962217b5ceb38185090f82e09
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoRemove qPlatformScreenForWindow from header.
Robin Burchell [Sun, 17 Aug 2014 13:39:27 +0000 (15:39 +0200)]
Remove qPlatformScreenForWindow from header.

Use of this was removed in 02e50ef592f28ec05654acf3f6c9b84d31736269.

Change-Id: I729282bfa9536380fc0d5b2702448cc54a90e37d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoqwindow-compositor: Fix null pointer dereference.
Robin Burchell [Sun, 17 Aug 2014 12:44:32 +0000 (14:44 +0200)]
qwindow-compositor: Fix null pointer dereference.

setCursorSurface may be invoked with a null surface.
This was exposed by tst_QWidget::destroyBackingStore.

Change-Id: Iac1ef6d2f17e5ee6a693ddbf3875b743bde2ded1
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoQWaylandWindow: Add a missing shell surface null check.
Robin Burchell [Sun, 17 Aug 2014 11:58:02 +0000 (13:58 +0200)]
QWaylandWindow: Add a missing shell surface null check.

Caught by tst_QWidget::mapFromAndTo.

Change-Id: I36e08ebfa3bae1ac8667ee828b1762867d71c66d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoqml-compositor: Error check loading of WindowChrome.
Robin Burchell [Sun, 17 Aug 2014 11:40:08 +0000 (13:40 +0200)]
qml-compositor: Error check loading of WindowChrome.

Change-Id: I76303b8640f013167159d94e8db7d673358c4983
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoqml-compositor: Clean up some unnecessary logging.
Robin Burchell [Sun, 17 Aug 2014 11:39:48 +0000 (13:39 +0200)]
qml-compositor: Clean up some unnecessary logging.

Change-Id: I1072d6efa059e01d8dcba98c90320bcc242d1c0f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoRemove QWaylandResourceCollection.
Robin Burchell [Fri, 15 Aug 2014 19:39:25 +0000 (21:39 +0200)]
Remove QWaylandResourceCollection.

Dead code, apparently previously related to clipboard.

Change-Id: I7b29a8d1730d7b28365cb293df95c6b71b8fdbc0
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoRemove left-over wayland include
Giulio Camuffo [Fri, 15 Aug 2014 18:07:17 +0000 (21:07 +0300)]
Remove left-over wayland include

Change-Id: Id436f5d327408db63b2b5a8c183f4d484410669c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoDon't include wayland-server.h in public headers
Giulio Camuffo [Fri, 15 Aug 2014 16:34:49 +0000 (19:34 +0300)]
Don't include wayland-server.h in public headers

Fix the cmake test

Change-Id: If610b26b43df50c7df4e796e08a16dbf0ba27e5c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix possible crash of the test client
Giulio Camuffo [Fri, 15 Aug 2014 16:38:13 +0000 (19:38 +0300)]
Fix possible crash of the test client

The cursor surface is not in the surfaces list when destroyed

Change-Id: Ie29224679776d0abec7862d2976be892c63521a7
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix client tests
Giulio Camuffo [Thu, 14 Aug 2014 13:57:47 +0000 (16:57 +0300)]
Fix client tests

Change-Id: I6511dfb826c522db3d8bd01c5670c06f187abff2
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFlush the wayland events on the dispatcher's awake signal
Giulio Camuffo [Thu, 14 Aug 2014 13:50:57 +0000 (16:50 +0300)]
Flush the wayland events on the dispatcher's awake signal

This is not normally needed, but it is when an app, like our client test,
needs to have the requests flushed out by a QCoreApplication::processEvents
call.

Change-Id: Id821eaf5b612dc44281141181a09718f409e7eb6
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix compositor tests
Giulio Camuffo [Thu, 14 Aug 2014 14:38:52 +0000 (17:38 +0300)]
Fix compositor tests

The test compositor was not updated after recent QtCompositor changes.
Make sure to create and use wl_shell and fix the "repaint" loop in the
frameCallback test

Change-Id: I06515f114a3b7b755c22aef7d193d48fda94d7af
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoReset the wl_keyboard/wl_pointer resource pointers if destroyed
Giulio Camuffo [Wed, 13 Aug 2014 10:20:44 +0000 (13:20 +0300)]
Reset the wl_keyboard/wl_pointer resource pointers if destroyed

Change-Id: I8693f845817d2dd4b0e0b54352c374f6a0e643d3
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix license test.
Robin Burchell [Wed, 13 Aug 2014 09:29:37 +0000 (11:29 +0200)]
Fix license test.

Add missing copyright headers and fix existing (bad) ones.

Change-Id: Ibbc6f3e996105305c8a2ed7d81ccee79795ee531
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
3 years agoMake the expose region local
Giulio Camuffo [Wed, 13 Aug 2014 07:30:39 +0000 (10:30 +0300)]
Make the expose region local

Change-Id: I570bbe77185637ebe621e6c915eef2f4442fdd84
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoBump version
Oswald Buddenhagen [Mon, 11 Aug 2014 14:57:35 +0000 (16:57 +0200)]
Bump version

Change-Id: Ice3cf6329f2dea88b58e7a6b61223394e98dcfb1

3 years agoDo not list a non-existing file in the project
Laszlo Agocs [Mon, 11 Aug 2014 13:50:15 +0000 (15:50 +0200)]
Do not list a non-existing file in the project

Change-Id: I191eb91a160486497c484dde7b92f06bb576cbbe
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix namespaced build
Giulio Camuffo [Thu, 7 Aug 2014 14:24:11 +0000 (17:24 +0300)]
Fix namespaced build

Change-Id: Id73f8ddffe00359f38c634fc88b1f81ac5638653
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
3 years agoAdd a way to have out of source shell integrations
Giulio Camuffo [Tue, 1 Jul 2014 12:56:11 +0000 (15:56 +0300)]
Add a way to have out of source shell integrations

Some platforms (especially non-desktop ones) may use a custom
Wayland shell extension, more tailored to the form factor than
the generic and desktoppy wl_shell or xdg_shell. Instead of stuffing
N protocol implementations in the QPA plugin use a plugin architecture
to allow them to live out of tree.
When creating a shell surface the QT_WAYLAND_SHELL_INTEGRATION env
variable will be checked, and if it points to a valid plugin that
will be used to create the shell surface, falling back to wl_shell
or xdg_shell if no plugin is specified.

Change-Id: I05019174bb915199dd726f5fdcc0385ef846e8de
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Philippe Coval <rzr@gna.org>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoWait to get wl_output's events before creating surfaces
Giulio Camuffo [Tue, 5 Aug 2014 08:29:27 +0000 (11:29 +0300)]
Wait to get wl_output's events before creating surfaces

Change-Id: I2eb4b40a4b8b1de7990d06b57b0d7a7b04ee9657
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoBind the globals with the highest version available
Giulio Camuffo [Tue, 5 Aug 2014 08:30:29 +0000 (11:30 +0300)]
Bind the globals with the highest version available

Change-Id: I639b124f15416905c17665755b3288c905880f39
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoMake sure to have a hardware integration when creating windows
Giulio Camuffo [Mon, 14 Jul 2014 12:15:16 +0000 (15:15 +0300)]
Make sure to have a hardware integration when creating windows

We need to do a full roundtrip and wait for the qt_hardware_integration
global before returning from QWaylandDisplay constructor. Waiting
for the screen is not enough, since there is no guarantee it will come
after the hardware integration global.

Change-Id: I34cb50b830632db7e5d5c7a502eeef778599b267
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoAdd transient parent and offset to QWaylandSurface
Pier Luigi Fiorini [Tue, 8 Jul 2014 00:43:58 +0000 (02:43 +0200)]
Add transient parent and offset to QWaylandSurface

Compositors now know more about transient surfaces.
With the parent and offset information, compositors can place transient
surfaces relative to their parent.

Change-Id: I73e08aad7bb1d8a7d40b2006208eb48e2a1a8455
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoResolve build warning on client code
Pier Luigi Fiorini [Fri, 1 Aug 2014 06:28:20 +0000 (08:28 +0200)]
Resolve build warning on client code

QString::QString(const char*) is deprecated, wrap thread name
with QStringLiteral.

Change-Id: Ic914d05e7bee6e3f1c6aa0bede44a6b6b85be565
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoMake Surface own its visibility property
Giulio Camuffo [Fri, 1 Aug 2014 10:47:30 +0000 (13:47 +0300)]
Make Surface own its visibility property

Change-Id: I5eb8ab7bfb16505c8a14c4d77c5ff55aa0e22cfc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoFix checking initial screen aspect ratio
Giulio Camuffo [Fri, 1 Aug 2014 11:55:49 +0000 (14:55 +0300)]
Fix checking initial screen aspect ratio

The first time QWaylandScreen gets an output_geometry() event its
screen() may not have been initialized yet, so manually check
if the output is portrait or landscape.

Change-Id: I1d58daee7a3f168a881a1e2d21956c52c09818fc
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoUse wl_surface.set_buffer_transform to signal surface rotation
Giulio Camuffo [Mon, 9 Jun 2014 19:52:29 +0000 (22:52 +0300)]
Use wl_surface.set_buffer_transform to signal surface rotation

Drop the custom request in the surface extension, and use the
wayland core mechanism.

Change-Id: I580f56c90bcd3b2c5a6da08d1a033b10790ac330
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoUse wayland core interfaces to signal output rotation
Giulio Camuffo [Mon, 3 Mar 2014 15:24:26 +0000 (17:24 +0200)]
Use wayland core interfaces to signal output rotation

The wl_output interface has an event for signaling the rotation of
the display, so use that instead of our own thing.

Change-Id: I8a017d575ee456a7a81649e19a015085fb784805
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoMerge remote-tracking branch 'origin/stable' into dev
Oswald Buddenhagen [Thu, 31 Jul 2014 12:12:26 +0000 (14:12 +0200)]
Merge remote-tracking branch 'origin/stable' into dev

Conflicts:
src/compositor/compositor_api/qwaylandsurfaceitem.cpp
src/compositor/wayland_wrapper/qwlshellsurface_p.h
src/compositor/wayland_wrapper/qwlshellsurface.cpp

Change-Id: I4ab33955153715150d3de6e991ff75910eee4416

3 years agoAdd more API to change QWaylandSurface properties
Giulio Camuffo [Thu, 3 Jul 2014 13:40:36 +0000 (16:40 +0300)]
Add more API to change QWaylandSurface properties

The previous patch allows for QWaylandSurface to call into custom
protocol implementations, but the other way around is needed too.
Instead of adding many public setters to QWaylandSurface this
makes QWaylandSurfaceInterface the way to set them, through
protected functions. This avoids calling the setters from other code
paths, which would bring the server and client states of the same
surface out of sync.

Change-Id: I9836c38835f10f6e63007b13d27a62884065f837
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoIntroduce QWaylandSurfaceInterface
Giulio Camuffo [Thu, 3 Jul 2014 13:37:47 +0000 (16:37 +0300)]
Introduce QWaylandSurfaceInterface

Wayland is designed to be easily extensible with new protocol,
unfortunately it currently isn't possible with QtCompositor.
A QtWayland compositor has two ends: the Wayland end and the shell/wm
end, which may be implemented in QML. These two ends communicate mainly
through the QWaylandSurface and the QWaylandSurfaceView classes, but the
Wayland end is currently unable to hook into custom protocol extensions.
This is the purpose of the new QWaylandSurfaceInterface class, and of
QWaylandSurfaceOp and its subclasses: based on the QEvent model,
QWaylandSurfaceOp has only a type member, and its type specific subclasses
have additional data if needed. A custom protocol implementation, such as
xdg_surface or my_fancy_surface, will use a QWaylandSurfaceInterface subclass
which will call its specific protocol functions when it gets the relative
operation requests from the parent surface.
The QWaylandShellSurface class is now redundant so it is removed.

Change-Id: I37a86157a251626215f57ce030c77a26bfd65126
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoDestroy the SurfaceBuffers and their textures after the wl_buffer are destroyed
Giulio Camuffo [Fri, 25 Jul 2014 11:46:15 +0000 (14:46 +0300)]
Destroy the SurfaceBuffers and their textures after the wl_buffer are destroyed

A SurfaceBuffer can live after its wl_buffer died, so make sure to delete
it when there is no surface or buffer reference that points to it anymore.

Change-Id: Id90453c74d14ca1414cb837b355430a510d5f07e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoFix fetching of the y-inverted value fomr the wayland-egl integration
Giulio Camuffo [Tue, 29 Jul 2014 12:52:01 +0000 (15:52 +0300)]
Fix fetching of the y-inverted value fomr the wayland-egl integration

The default return value of isYInverted() is true, but we want to return
false by that point, unless the ifdeffed part was thrown away.

Change-Id: Ia875c1e3083c7c378cc7dd1f4b634f6fa7500f5b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoFix the y inversion of QWaylandSurfaceItem
Giulio Camuffo [Tue, 29 Jul 2014 13:18:46 +0000 (16:18 +0300)]
Fix the y inversion of QWaylandSurfaceItem

Change-Id: Id42223b46658aa4cdcb0319ec5b6b2df9d8ca733
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoUpdate ignore list
Pier Luigi Fiorini [Fri, 25 Jul 2014 20:07:45 +0000 (22:07 +0200)]
Update ignore list

Change-Id: I438e109b16d7de6e4ff9108eeeff9da3d2a9586b
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoAdd a boolean return value to QWaylandCompositor::openUrl()
Vesa Halttunen [Wed, 23 Jul 2014 14:12:17 +0000 (16:12 +0200)]
Add a boolean return value to QWaylandCompositor::openUrl()

Change-Id: I46639a306461ac38c05a0a4459b56d49d7708ab5
Reviewed-by: Vesa Halttunen
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoAuto repeat only the keys which should be repeated
Giulio Camuffo [Tue, 22 Jul 2014 12:24:57 +0000 (15:24 +0300)]
Auto repeat only the keys which should be repeated

Change-Id: I283bf6cc2f6c338fc769d77dd84ae7acb08eb7be
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoDo not send auto repeat key events to the clients
Giulio Camuffo [Tue, 22 Jul 2014 12:21:11 +0000 (15:21 +0300)]
Do not send auto repeat key events to the clients

Change-Id: Icf1cd7211cb470115c9ce5e0ad5180dbb0ce28b9
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoFix build with nogl
Pier Luigi Fiorini [Mon, 21 Jul 2014 16:53:57 +0000 (16:53 +0000)]
Fix build with nogl

Change-Id: I1a70cfdbd450c94759f81d4328d821843541c063
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoGive a name to the event handling thread
Giulio Camuffo [Mon, 7 Jul 2014 12:48:06 +0000 (15:48 +0300)]
Give a name to the event handling thread

Change-Id: I5c6073bc1908e54bc5ae50d4b6b6044974f1ad60
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
3 years agoRemove deprecated method in brcm_egl plugin
Pier Luigi Fiorini [Fri, 25 Apr 2014 01:00:53 +0000 (01:00 +0000)]
Remove deprecated method in brcm_egl plugin

QPlatformIntegrationPlugin::keys() was removed.
This fixes brcm_egl build.

Change-Id: I62af15a340a63794e6c6980ac6d72138d1cd60c8
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix creation of custom shells
Giulio Camuffo [Mon, 9 Jun 2014 08:44:32 +0000 (11:44 +0300)]
Fix creation of custom shells

The previous virtual method initShell() was not working because
it was called from QWaylandCompositor constructor.
Replace that with a mthod to create the default shell to be
manually called by the compositors if they so choose.

Change-Id: I35a1dc0edfaf4237ca47b532645ac0d95752311c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoFix a few project warnings
Giulio Camuffo [Mon, 7 Jul 2014 15:00:07 +0000 (18:00 +0300)]
Fix a few project warnings

Change-Id: I342b677f529994430125797f1b971f8723e1355a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
3 years agoAdd cmake test for QtCompositor and disable cmake files for QtWaylandClient
Giulio Camuffo [Mon, 7 Jul 2014 14:54:04 +0000 (17:54 +0300)]
Add cmake test for QtCompositor and disable cmake files for QtWaylandClient

Change-Id: Id6e2d46b55e521218a3c0f44cf9a4a2be5f0df7f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
3 years agoAvoid crashing race condition.
Gunnar Sletta [Mon, 30 Jun 2014 09:14:52 +0000 (11:14 +0200)]
Avoid crashing race condition.

Change-Id: I940bcbc509a689804a02f71af45f5efc19bccf9f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoDelete data device manager while display is still alive.
Gunnar Sletta [Fri, 27 Jun 2014 12:56:12 +0000 (14:56 +0200)]
Delete data device manager while display is still alive.

Change-Id: I7691e06d75866034c93020ebdfb45421275fcf9d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoHave more guards against mis-use of surfaceless QWaylandSurfaceItems
Giulio Camuffo [Wed, 25 Jun 2014 11:26:12 +0000 (14:26 +0300)]
Have more guards against mis-use of surfaceless QWaylandSurfaceItems

Change-Id: Ib380076e46b7d70442381be3328a240d81c77110
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoAllow for the creation of surface-less QWaylandSurfaceItems
Giulio Camuffo [Fri, 13 Jun 2014 11:55:01 +0000 (14:55 +0300)]
Allow for the creation of surface-less QWaylandSurfaceItems

The compositors may want to have server-side only views.

Change-Id: I682b352660d1ecbf0c757b4bee9d0482cfc88006
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoxdg-shell: upgrade to support current version (weston-1.5.0)
Philippe Coval [Tue, 10 Jun 2014 14:22:17 +0000 (16:22 +0200)]
xdg-shell: upgrade to support current version (weston-1.5.0)

The protocol file is a raw copy of

Source: http://cgit.freedesktop.org/wayland/weston/plain/protocol/xdg-shell.xml?id=1.5.0

Task-number: QTBUG-38633/related
Change-Id: I41ca2f89c09a8b6348ce2fbf6d59f44b4c8134df
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Philippe Coval <rzr@gna.org>
3 years agoignore: emacs backup files
Philippe Coval [Fri, 13 Jun 2014 07:50:10 +0000 (09:50 +0200)]
ignore: emacs backup files

Change-Id: Ib1159d42134a58a3e9e91306e58a63a4216b3494
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix wrong fetching of the y-inverted value
Giulio Camuffo [Mon, 16 Jun 2014 13:19:37 +0000 (16:19 +0300)]
Fix wrong fetching of the y-inverted value

Change-Id: I027f8c78f652bae2659fdb82541bc24f54a0a070
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
3 years agoReduce headers inter-dependency in the QPA plugin
Giulio Camuffo [Mon, 16 Jun 2014 07:37:37 +0000 (10:37 +0300)]
Reduce headers inter-dependency in the QPA plugin

Change-Id: I8b810e54531453b6a80250555c21bb0b1e6e76cc
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
3 years agoFix crash when deleting ShellSurface objects
Giulio Camuffo [Fri, 13 Jun 2014 07:24:11 +0000 (10:24 +0300)]
Fix crash when deleting ShellSurface objects

We must not leave dangling wl_resource objects with their
user data pointing to a deleted object.

Change-Id: I54aa7f03bc7542fdea144dd0af8da7f600b4d21c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoFix unsetting the shell surface on deletion
Giulio Camuffo [Thu, 12 Jun 2014 10:58:44 +0000 (13:58 +0300)]
Fix unsetting the shell surface on deletion

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