summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Update the protocol to 1.4 and raise the required libwayland versionGiulio Camuffo2015-02-0310-22/+360
| | | | | | | | Wayland 1.4 introduces wl_subsurface which is quite an important addition. Change-Id: I48375f60adce556c9989872319f4d073e4a7b13b Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Remove unused headerPier Luigi Fiorini2015-01-301-1/+0
| | | | | | | Remove qwaylandcompositor_p.h leftover. Change-Id: I2ede92db92894f14301c89cc28c896cfdc6d3563 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Namespace the platform pluginsGiulio Camuffo2015-01-29132-26/+575
| | | | | | | | | | | | There currently is a QWaylandInputDevice class both in the wayland QPA plugin and in the QtCompositor API. This causes the qwindow-compositor example to crash when running nested in a wayland session due to a mismatch between the two classes. By namespacing all the plugin code we make sure that name clashes will not happen anymore. Change-Id: I17497cff697599200bea68bf01dfde474526390f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-196-6/+19
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I65c8503cf632699129ebb6b4f01721b74be78def
| * Recreate the surface textures after the scenegraph invalidationv5.4.1Giulio Camuffo2015-01-151-0/+1
| | | | | | | | | | | | | | | | | | When the scenegraph is invalidated we delete the surfaces texture. Set the update flag to true so that when the scene graph is again initialized and starts to draw a frame the textures will be recreated. Change-Id: I2fb171e4bed517e48fa2311c22651150f3e605f7 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Set the composing string of the wayland input methodGiulio Camuffo2015-01-132-0/+17
| | | | | | | | | | | | Task-number: QTBUG-43346 Change-Id: I9bc6d804ddca59a7a0173b8f0d3ec2f268fe9a59 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Remove unused membersThiago Macieira2014-12-313-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang found two problems with this from QWaylandDataDeviceManager. First, it's a class, not a struct. Second, nothing is using this private member. qwaylanddatadevicemanager_p.h:66:5: warning: struct 'wl_data_device_manager' was previously declared as a class [-Wmismatched-tags] qwaylanddatadevicemanager_p.h:66:36: warning: private field 'm_data_device_manager' is not used [-Wunused-private-field] And also this one: qwaylandextendedoutput_p.h:61:21: warning: private field 'm_screen' is not used [-Wunused-private-field] Change-Id: Ifc8f28f92190547dcb0a5319aa6fc14277894f15 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Send proper mouse enter eventsGiulio Camuffo2015-01-134-50/+92
| | | | | | | | | | | | | | | | The wl_pointer.event carries the surface local position of the pointer. Notify Qt of it, without pretending it to be a motion event. Change-Id: Ibbe1d125a93b478f9c350a50bfea25b01f628178 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Allow retrieving the egl display for a QWindow on waylandGiulio Camuffo2015-01-051-0/+2
| | | | | | | | | | | | | | | | This allows a compositor running with the wayland qpa inside another compositor to provide EGL to its clients. Change-Id: I308fb909c8168955148be152bf314a53c0e5ca43 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Make use of the new QPlatformIntegration::destroyScreenGiulio Camuffo2014-12-291-2/+4
| | | | | | | | | | | | Task-number: QTBUG-41141 Change-Id: I0bd789cc1090f7e0e7615b47c33a4e4179677398 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-2911-12/+26
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandsurface.cpp Change-Id: I3ee40153c959dbe31ea685571c5a8bb1ae36606e
| * Fix wrong check condition.Giulio Camuffo2014-12-121-1/+1
| | | | | | | | | | Change-Id: Iecd5050097abcafa06073d41a31d1ae31fac5b42 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * Fix dangling pointer access when getting dnd data in some casesGiulio Camuffo2014-12-112-3/+4
| | | | | | | | | | | | | | | | | | Calling wl_data_source.destroy(); wl_data_offer.receive(), where the wl_data_offer is referring to the destroyed wl_data_source, was crashing the compositor. Change-Id: Iab352d63f8a93aebd0bfbcf1dc26c0e8a48a523a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Fix possible double free when hiding a windowGiulio Camuffo2014-12-062-0/+5
| | | | | | | | | | | | | | | | | | There was a race condition between the gui and the wayland event thread which could lead to double freeing the QWaylandShmBackingStore's frame callback. Protect the wl_callback_destroy calls using a mutex. Change-Id: Ia70ebac208a6d4450328ba5254a850be26d84d6d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Silence uninited variable compiler warningsLaszlo Agocs2014-12-031-1/+1
| | | | | | | | | | | | | | | | The code is correct but some compilers may still warn about dragData not getting initialized. Silence them. Change-Id: Ib52321667fc5094e22ebbef538b72b5477e6f10b Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * Don't access a dangling pointerGiulio Camuffo2014-11-201-0/+2
| | | | | | | | | | | | | | | | The surface's resource may have been destroyed, return a null client in that case. Change-Id: I3d7e0f0e94008e003e43f1987e6560dd73f5c5db Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Remove deleted views from the listGiulio Camuffo2014-11-141-1/+3
| | | | | | | | | | Change-Id: Ic4c998347e14c17693bea461452d6ee8fc41064b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Make sure to have valid texturesGiulio Camuffo2014-11-103-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The texture of QWaylandSurfaceItem's texture provider was updated in QWaylandSurfaceItem::updatePaintNode(). That is fine as long as the texture is accessed after the updatePaintNode() call, but if not we would access an invalid texture. That could happen when another QQuickItem subclass was accessing the textire in its updatePaintNode(). We don't have any guarantee on the order of the updatePaintNode() calls, so the other item could be updated before the QWaylandSurfaceItem. Change-Id: I7320d445c72796ce26f8d8483175a35e9c6840e7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | xdg-shell: upgrade to support current version (weston-1.6.0)Philippe Coval2014-12-283-190/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many inprovements on windows's decorations, Also handle compositor events (test: Super+Shift+F , Super+Shift+M) The protocol file is a raw copy of Source: http://cgit.freedesktop.org/wayland/weston/plain/protocol/xdg-shell.xml?id=1.6.0 Task-number: QTBUG-38633/related Change-Id: I667ec52c8a7e34d74b60174a671c89671f841d6b Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Implement high-dpi supportMorten Johan Sorvig2014-12-179-13/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wayland 1.2 added support for display scaling, where wl_output has a "scale" event informing the the client that the compositor will scale the output surfaces by the given factor. The client then has the option of providing large surfaces to match the target pixel densety and bypass the compositor's scaling. This is done by calling wl_surface::set_buffer_scale. Re-use the current high-dpi support in Qt by implementing devicePixelRatio() for QWaylandScreen and QWaylandWindow. Provide high resolution buffers both for raster and OpenGL graphics. Introduce a new coordinate system: buffer coordinates, which is related to the window coordinate system via an "int scale" scale factor. This scale factor corresponds to Qts qreal devicePixelRatio, but we keep the name and the type in the QtWayland implementation. Change-Id: Ie10d7e5b4833480a9a25d96a26ad02150eb6e83f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Enable Qt WebEngine on WaylandLaszlo Agocs2014-12-045-1/+60
| | | | | | | | | | | | | | | | | | The native resource getters that are supported by eglfs will have to be supported by the wayland platform plugin too. (on wayland-egl at least) Change-Id: Ibbab649c04785dbde177342c45b9bc6f1edd954d Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Merge "Merge branch '5.4' into dev" into refs/staging/devFrederik Gladhorn2014-11-1576-498/+1211
|\ \
| * | Merge branch '5.4' into devGiulio Camuffo2014-11-1576-498/+1211
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge done by Giulio Camuffo Conflicts: src/client/client.pro src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandinputdevice_p.h src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurface.cpp src/compositor/compositor_api/qwaylandsurface_p.h src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81
| | * Be more careful when destroying wl_resourcesv5.4.0-rc1v5.4.0Giulio Camuffo2014-10-287-30/+17
| | | | | | | | | | | | | | | | | | | | | | | | The compositor must not destroy wl_resources when it wants to, else it breaks the contract with the client. Change-Id: Ic0d298072cdf0954d2504c04bff2bcc99733e621 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Gracefully fallback when xkb context creation failsOlivier Blin2014-10-231-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xkb context creation can fail when xkeyboard-config files are not available. This changes qwlkeyboard to gracefully fallback on the QT_NO_WAYLAND_XKB path, as suggested by Giulio Camuffo. Change-Id: Ic57d80b6aa3e9fbd8a393a3ca54dff768a4c3e83 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| | * Fix fd leak in case of ftruncate() failure in qwlkeyboardOlivier Blin2014-10-211-1/+3
| | | | | | | | | | | | | | | | | | Change-Id: Id7d6582d4e139763634c7022548b558d4a2f8ec2 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Fix crash when cursor theme can not be loadedOlivier Blin2014-10-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add a debug message about theme loading failure. This is not necessarily fatal, some embedded applications could still function properly without a cursor. Change-Id: Ib3e2ee43b00630ee77997c7472a95ac5a22c2cc2 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Fix -no-opengl buildsLaszlo Agocs2014-10-144-0/+8
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-41677 Change-Id: I039ec581e960eb70eb04aed6e65add70c563ba77 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Be compatible with older compositorsGiulio Camuffo2014-10-137-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | When binding globals take care of the version the compositor provides and don't call requests that the compositor doesn't implement. Change-Id: Iea0c534fb9e005720857e2778e380b6a9c22a6f3 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Pass the relevant serial when setting the selectionGiulio Camuffo2014-10-092-2/+3
| | | | | | | | | | | | | | | | | | | | | This fixes copying in Weston. Change-Id: Icbdb81078e8df4575bbe440321773131ba27ebbf Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Fix the compositor's wayland versioningGiulio Camuffo2014-10-0936-83/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot just assume all clients implement the same version of the various interfaces as the compositor does. Keep track of them, and react accordingly when creating a resource or sending an event. Change-Id: I9792433a14d49c5c4df0c892fc1349ce0dfb0d43 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Remove duplicate size property declarationMikko Levonmaa2014-10-061-1/+0
| | | | | | | | | | | | | | | | | | Change-Id: I9700c15066c030436dbe2f9a09b0851b7f4350ae Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Fix shm windows sometimes not showing after being hiddenGiulio Camuffo2014-10-063-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandShmBackingStore installs a frame callback on flush, and subsequent flushes will not attach a new buffer until the callback is fired. If the window is hidden while we're waiting for the callback, we attach a NULL buffer, so the compositor will not redraw the surface and will not fire the frame callback. When showing the window again the backing store's flush() will wait indefinitely for the frame callback to attach its buffer. To fix it destroy the frame callback when the window is hidden. This was easily noticeable when fast switching between popup menus. Change-Id: Ic0c71ed79e2fab9faf452f63b05bc4576ea9a3ba Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Call ::exit() from the gui thread onlyGiulio Camuffo2014-10-024-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | ::exit() is not thread safe, so make sure to not call it more than one time, once from the gui thread and once from the wayland event thread. Change-Id: I80905c6d996cb827a5101ae6d6c9bc12a267ba71 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Support the creation of >= 3.x OpenGL contextsGiulio Camuffo2014-09-306-119/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the EGL_KHR_create_context extension if available to create modern gl contexts. We disable window decorations on core profiles because that mandates a VAO to be used. Change-Id: Id6044e64f6736244ae9d593af4d68c4000a31de6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Send also repeat key release eventsGiulio Camuffo2014-09-281-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | We were sending only key press events for the key autorepeat, going out of sync with the release events. Xorg sends both relase and press auto repeat events, do so here too. Change-Id: I41a9bfaff50afea779a7572220f6a01b507e95ac Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| | * Use the screen resolution to determine whether a screen is portraitGiulio Camuffo2014-09-242-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using the screen physical size to determine if a screen is portrait or landscape, but we may not always get a valid size. Instead use the screen resolution. The orientation is then calculated in the wl_output.done handler, since we don't know the resolution yet when receiving the first wl_output.geometry event. Change-Id: I3554f916e54db829f49fa3d1ea24f7ce1ff24e7c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * decorations: Remove strange set dance between QWaylandWindow & ↵Robin Burchell2014-09-233-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandAbstractDecoration. This makes absolutely no sense. Just do things inline. Change-Id: Ic6d4e62bc9b3c0a4533f63740f2608a0be201047 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * QtWaylandClient: Pluginize window decorations.Robin Burchell2014-09-2313-403/+880
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert to a D-pointer, split between abstract base class and an implementation. Also move implementation of the current built-in decoration to the "bradient" plugin, named in glorious memory of the programmer-designed blue gradient that will forever sear our eyeballs. The decoration plugin may be specified using the environment variable QT_WAYLAND_DECORATION. Change-Id: Idc99ab06ae138ad299bad2b62b9595379bd007ab Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| | * Rename QWaylandDecoration => QWaylandAbstractDecorationRobin Burchell2014-09-2311-48/+47
| | | | | | | | | | | | | | | | | | | | | This is in preparation for decoration plugins. Change-Id: Idb322a7a5cbc2eb5bf2cce019073f9f4fb46297f Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | | QWaylandInputDevice: Fix missing virtual destructor declarationLouai Al-Khanji2014-11-101-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | QWaylandInputDevice recently gained a virtual function, making it a polymorphic class. It should thus have a virtual destructor as well. Discovered through a GCC diagnostic: warning: deleting object of polymorphic class type 'QWaylandInputDevice' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor] Change-Id: Ie816caabea56cde320768dcc8aba6b5ad50bf4c1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Fix compiler warning about unused d variableLouai Al-Khanji2014-10-281-2/+0
| | | | | | | | | | Change-Id: Ia3ee8b13f1eacc435152149a1ee65fb62658506e Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Support for multiple input devicesMikko Levonmaa2014-10-209-24/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows the registration of multiple input devices for the compositor via private APIs. Since the Qt stack does not support separate input devices via the QPA, the identification of each device (wl_seat) is left up to the implementor. The compositor will identify input event via the QWaylandInputDevice::isOwner method. Usually this will happen when an item on the UI has received an event and would like to send it to the client surface. See QWaylandSurfaceItem for more details. Includes basic unit tests Change-Id: I7ee1db49388713bf3076c23cf8f8a165aefc2fe0 Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Allow client side input device customizationMikko Levonmaa2014-10-0612-178/+654
| | | | | | | | | | | | | | | | | | | | | | Introduces QWaylandInputDeviceIntegration plugins to allow customization of input device related behavior. The plugin can be activated via the environment variable QT_WAYLAND_INPUTDEVICE_INTEGRATION Change-Id: If5629737752afacb29161f51c1b7c6e171fb2758 Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-1961-270/+563
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Add or remove popup grabber when the surface is mappedPier Luigi Fiorini2014-09-182-11/+16
| | | | | | | | | | | | | | | | When the surface is mapped add or remove the popup grab as expected. Change-Id: I807753393ef2753bc96c698f766523186ee88fd2 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * Don't send the wrong physical size to clientsGiulio Camuffo2014-09-182-2/+17
| | | | | | | | | | | | | | A 0x0 size means the compositor doesn't know what the real size is. Change-Id: I79cac0482839399d4a53e9556bb999592af555a5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Ignore negative screen physical sizeGiulio Camuffo2014-09-171-1/+1
| | | | | | | | | | | | | | | | | | Weston can send in some cases a negative physical size in the wl_output.geometry event. While it is not clear whether that is legal go the extra mile and catch it. Change-Id: Ie2fbab84e653ad77732a72b6ca61509eb7849895 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Fix retrieving the selection/dnd dataGiulio Camuffo2014-09-152-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing a roudtrip on the custom event queue in the wl_data_offer.offer handler is broken because that triggers a wl_data_device.selection event, which emits the QClipboard changed signal, so code listening to it may end up trying to retrieve the clipboard data before the roundtrip ends. Additionally, we're calling wl_data_offer.receive for each mime type, even if then we never read from the fd, making the source client do work for no reason. Instead, call wl_data_offer.receive retrieveData_sys, that is when actually retreiving the data. We don't need to install a roundtrip after that, just flushing out the requests is enough, because we wait up to one second for the source client to write into the fd. Change-Id: I180779e375ebd5a22af7084458505a41107fab19 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * Don't give bogus values for a screen physical sizeGiulio Camuffo2014-09-151-1/+4
| | | | | | | | | | | | | | | | If we don't have a valid physical size for a screen, i.e. (0x0), return the default value from the base class. Change-Id: Ia7b6f90ee73e07014ab752ceb165426812c49415 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>