summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Put the pointers current view and current possition into a separate classJørgen Lind2015-08-282-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also, if the current mouse coordinate ends on the boundary of the surface, then subtract 0.01 from the mouse coordinate. This is to work around Qt's mouse event propogation which is QRectF::contains which is including the boundary, and Wayland which uses a strict contains. We cant just discard events since Qt handles also enter/leave and clicking state etc. Change-Id: I919651232a5027b9fe0cb15b6838d3b1fee682df
| * | | Make it possible to set a QWaylandSurface on the QWaylandSurfaceViewJørgen Lind2015-08-284-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | This will allow us to use QWaylandSurfaceItem from within QML Change-Id: I6ecfbf3a5de5f5a748a6a85295b9741316fef976
| * | | Deprecate the cursor change request and make it a signalJørgen Lind2015-08-281-2/+10
| | | | | | | | | | | | | | | | Change-Id: Icafab695071259e2112e9742ba46a19c1dc74586
| * | | Make it possible for QWaylandSurfaceItem to children of arbitrary itemsJørgen Lind2015-08-285-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main problem is that the position of the QWaylandSurfaceItem is changed through the position of the views setPos function. However, it might be that we don't want the surface position to map it directly. Rename QWaylandSurfaceView::setPos to setRequestedPos Then let the compositors choose what to do with this position Change-Id: I43c74baad688d2f3e49ca091bbf436c718e81318
| * | | Make the attach offset available through a signal on QWaylandSurfaceJørgen Lind2015-08-283-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This can then be picked up by ie. the shell_surface which can adjusts its view accordingly Change-Id: Iee3efa243c59b259834e599312d687401528e9c4
| * | | Initialize shellsurface pointerJørgen Lind2015-08-281-0/+1
| | | | | | | | | | | | | | | | Change-Id: I05bac886146be66a82dcb5f7a3e57bb5eba1d65c
| * | | Add a shellView property on QWaylandSurfaceJørgen Lind2015-08-284-0/+20
| | | | | | | | | | | | | | | | Change-Id: I68d05698b3caed11ccec39ef06ac5f912d782cf2
| * | | Make QWaylandCompositor::primaryOutput a Q_PROPERTYJørgen Lind2015-08-281-0/+1
| | | | | | | | | | | | | | | | Change-Id: I2a5c9556549fa3dbc4ad8b399a32266acbcc712b
| * | | Make QWaylandCompositor inherit QObjectJørgen Lind2015-08-282-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And remove the constructor arguments, and just having parent as a constructor argument. This requires QWaylandCompositor to have a create semantic familiar from QWindow and QOpenGLContext. On create the native wayland socket is created and initialized. Also the virtual functions surfaceCreated and surfaceAboutToBeDestroyed have been converted to signals, removing the need to subclass QWaylandCompositor Examples have been changed to avoid having two super classes inheriting QObject. This is done by either making the QWindow subclass a member or making the QWaylandCompositor a member. Change-Id: I317d37e2adca15bfe4e1904e20ab0d83943b2d45
| * | | Add createSurface factory function on QWaylandCompositorJørgen Lind2015-08-281-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | This simplifies subclassing the compositor getting Change-Id: I392b84febae62df042b23fa806360bc068bf984f
| * | | Make QWaylandOutput::handle constJørgen Lind2015-08-281-1/+0
| | | | | | | | | | | | | | | | Change-Id: I880cb15e056de4f6f5dcf97ea570d7bfb625c294
| * | | Move surface management to outputsJørgen Lind2015-08-286-16/+80
| | | | | | | | | | | | | | | | Change-Id: I427e576a4e0834d6266af2670f7ff47e078153d4
| * | | LGPL v3 license change for Qt Wayland CompositorJørgen Lind2015-07-2452-1378/+1184
| | | | | | | | | | | | | | | | Change-Id: I84ed248b471464214d935352768f300d4b90dec3
* | | | Fix typo in function nameMikko Levonmaa2015-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I63cc84c4d68466e257bac6020d8201e72e995373 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | | | Actually set the subsurfaceMikko Levonmaa2015-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia05413ca9bbd3bb09475425f3696b6de90cdd29a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-274-19/+72
|\ \ \ \ | | |_|/ | |/| | | | | | Change-Id: Idc8300948e3d52bfe2c14c62230280a68b2ed100
| * | | Support EGLStream in wayland-eglLaszlo Agocs2015-10-202-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Wayland on NVIDIA. Tested with a Jetson TK1 Pro and Vibrante Linux. With just the hw integration no compositors would work out of the box since EGL_KHR_stream_consumer_gltexture only allows connecting to the texture bound to GL_TEXTURE_EXTERNAL_OES, meaning that assumptions about the target always being GL_TEXTURE_2D break horribly both in C++ and in shader code. In addition, buffers have to be extended with an additional updateTexture() operation as EGLStream requires to call ConsumerAcquire on every frame. Previously there was no concept of this as calling createTexture() on attach() was sufficient. Qt Quick bits are omitted since the refactored compositor API is pretty different. This means that QML compositors will not currently function in this environment. The qwindow-compositor example is enhanced to support the external texture target, but this won't apply for the refactored branch either. It is provided for testing purposes for the time being, and to show how C++ compositors can support different texture targets and correct operation with EGLStreams. Done-with: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Change-Id: I0e209fc0cbcf435cca83528d938eb50e4bdceb82 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
| * | | Update focusResource if needed when wl_keyboard is boundOlivier Blin2015-10-202-8/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a QtWayland compositor gives focus to a surface right after its creation during the client startup, the keyboard resource may not be bound yet by the client. In this case, the surface is correctly marked as focused, but the keyboard resource is never marked as focused, and thus no keys are ever sent to the client. To fix this, the focusResource is updated if needed after wl_keyboard is bound. This can be reproduced with weston-simple-im (patched to use wl_shell instead of xdg_shell) and qml-compositor, modified to enable TextInputExtension and call takeFocus() at the end of windowAdded(). Change-Id: I551cb5bc56c05a1e5187b23108f4ef80468782dc Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * | | Fix setting focusDestroyListener when no keyboard resource is boundOlivier Blin2015-10-201-4/+8
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | When no keyboard resource is bound, the destruction handler for the focused surface was not called, and the pointers to focused objects were not reset. Thus the m_focus surface pointer could become invalid. Change-Id: Iee404219304ae7b2bae87131ab140ab134e98118 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-1528-22/+332
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandintegration.cpp Change-Id: I29120f06d33c2d383a41cf35ca4a59f5d8548ad7
| * | Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-0526-0/+286
| | | | | | | | | | | | | | | Change-Id: I70c01453b3939d1d645d626ae84c21ab4c9d267a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * | Fix updating the keymap when no key is pressedGiulio Camuffo2015-09-031-2/+1
| | | | | | | | | | | | | | | Change-Id: I55961a32a17dbf35b380f8a4b75433a6b694dd4a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
| * | Merge remote-tracking branch 'origin/5.5' into 5.6v5.6.0-alpha1Liang Qi2015-08-283-20/+45
| |\ \ | | |/ | |/| | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
| | * Don't crash if loading the keymap failsGiulio Camuffo2015-08-272-20/+37
| | | | | | | | | | | | | | | | | | | | | Instead throw a warning and keep using the old one. Change-Id: I1533b3930d4d8c884db922b0d6dd567ef7e4f67c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
| | * Reset surface transientParent when the parent is destroyed.Mikko Harju2015-08-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | If a transient parent of a surface is destroyed before the surface itself, reset all references to that parent surface. Change-Id: I5b748099d8a5502632d8846c5de5381b5f28b665 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | | Implement the wl_subcompositor interface server-sideGiulio Camuffo2015-10-017-170/+134
|/ / | | | | | | | | | | | | | | | | | | | | This change removes the qt_sub_surface extension and replaces it with the standard wl_subsurface. Only the bare minimum functionality is implemented, the wl_subsurface requests are left as dummy handlers currently. Change-Id: I025304072cf157f732e90c4b5649a07b295fdea5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Mikko Levonmaa <mikko.levonmaa@bitfactor.fi>
* | Use xkbcommon for internal key events tooGiulio Camuffo2015-07-235-10/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To manage the keyboard state and send key events to clients we use the xkbcommon library (unless disabled). That means that we currently have a separation between key events outgoing to clients and key events being used internally in the compositor, resulting in different keysyms being produced in the two cases for the same hardware key. Filter the key events coming from the underlying platform and modify them according to the xkb state instead. Change-Id: I4c6678be68e5b214b2b9cd0222dc9f425c580085 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Add a mechanism to delay unmapping of surfacesGiulio Camuffo2015-07-152-4/+31
| | | | | | | | | | | | | | | | | | | | When a client attachs a NULL buffer on a surface we may want to hang on to the old buffer for a bit, e.g. to do a hide animation. Add the QWaylandUnmapLock class to keep a surface mapped after an attach(0) request. Change-Id: I5d5be0b36410a76a58d2b68c1b2ac5e3b875a801 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-295-3/+22
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ic75157b11eee188608c3ac7ed6fb1a033bb72750
| * Fix xkb keymap string leak in the compositorOlivier Blin2015-06-121-0/+1
| | | | | | | | | | Change-Id: Ie02e6667e5867b729cf5a519705ded4f79b9f4b1 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Fix QWaylandDrag leak in the compositorOlivier Blin2015-06-122-2/+2
| | | | | | | | | | | | | | Make it a scoped pointer. Change-Id: Iaeef87cad2022496ebe3a7c746b02584fac9a485 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Fix build without OpenGLOlivier Blin2015-06-122-1/+19
| | | | | | | | | | | | | | | | Also fix a comment alongside. Change-Id: I0091a89ff8e7ed46e769ea47a0225bc87db2c1f5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | update keymap right away when no key is currently pressedCedric Chedaleux2015-06-161-6/+13
| | | | | | | | | | | | | | | | | | Keymap update was only performed when a key was pressed. A key press right after a keymap update was pretty long. Keymap may therefore be updated if no key is currently pressed. It avoids waiting for the next key press. It must also be set when last key was released and do no need to wait for the next key press. Change-Id: I9646a02f3112c8beb0f1cf90139e2b69af55a9b0 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-036-21/+76
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
| * Move surfaces to outputsPier Luigi Fiorini2015-04-216-21/+77
| | | | | | | | | | | | | | | | | | Moving surfaces to belong to a specific output. Surfaces can be viewed on a different output anyway. Change-Id: I9ef76300f85190d84b83431374e76e581786e4e7 Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Remove output extensionPier Luigi Fiorini2015-05-067-172/+2
| | | | | | | | | | | | | | This protocol is empty now and is no longer used. Change-Id: I45e79fb86a67b4cebdc307170218fa039b2aa27f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Introduce the surface role conceptGiulio Camuffo2015-04-232-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a concept originating initially from an implementation detail in Weston which was later formalized in Wayland 1.7. A wl_surface by itself will not be shown on screen, it must have a 'role' attched for that to happen. A role can be a shell surface, a pointer surface, ... Once a role is set on a wl_surface it cannot be changed, attempting to do so should send a protocol error. It is however allowed to destroy and recreate a new i.e. wl_shell_surface for the same wl_surface. This patch introduces the role and role handler concepts. A class such as a shell surface implementation should inherit from SurfaceRoleHandler, and have a 'static SurfaceRole *role()' function, which will be used to check against the role the surface has when the role handler is set to it. This changes introduces the new plumbing code but does not port existing code to it. Eventually this new API should become public. Change-Id: I43dc809b86051b7528ae6c39f796b9a96719ffd0 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-191-0/+1
|\| | | | | | | Change-Id: I133110d1deaa09e400e6cbaa704dfd0f32aca974
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-151-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandshmbackingstore.cpp src/client/qwaylandwindow.cpp Change-Id: I795fd08f0fc5d3cb5ed55bf16e724f66b7567723
| | * ShellSurface: fix leak of QWaylandSurfaceItem on destructionOlivier Blin2015-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QWaylandSurfaceView/QWaylandSurfaceItem object is never destroyed from ShellSurface. This was also leaking the underlying GL texture. Task-number: QTBUG-41180 Change-Id: If74c956075744115b8b5a7e8cb89b584714ec7e6 Done-with: Nicolas Marc <nicolas.marc@softathome.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | | Keep Surface's visibility is in sync between client and compositor.Gunnar Sletta2015-03-234-14/+9
|/ / | | | | | | | | | | | | | | | | | | | | In change fa32466916f1e0fbd2be28bd48df2d9edfcd5e5f we moved the visibility variable from QtWayland::ExtendedSurface to QtWayland::Surface. But we didn't move the code in the ShellSurface that kept this state in sync with the client. As a result the client and compositor would get out of sync. Change-Id: I54a7cb9f4b0669d3f3839ac8a29d8c42407195e2 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Send done and scale events only when clients support wl_output >= 2Pier Luigi Fiorini2015-03-101-8/+14
| | | | | | | | | | | | | | | | Those events were added with wl_output version 2 and we can't send them to clients supporting wl_output version 1. Change-Id: I4a673b8cc0476675532d31b4391a537d8473987b Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Update copyright headersJani Heikkinen2015-02-1754-239/+223
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* | Add QWaylandOutput to support multiple outputsPier Luigi Fiorini2015-02-0812-174/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new QWaylandOutput class to support multiple outputs. Each QWaylandOutput need a window for rendering. Rename OutputGlobal to Output and Output to OutputResource. Add support for physical size, mode and available geometry. Use better defaults for geometry and refreshRate from the QWindow if available. A window is no longer passed to QWaylandCompositor constructor and all output related methods are removed, however one or more outputs are required for hardware integration. QWaylandCompositor returns a list of outputs and offers an API to add or remove outputs. Hardware integrations can run headless. Change-Id: I742996571ddb78328f7bfa4f79b25a81995279e1 Done-with: Jan Arne Petersen <jan.petersen@kdab.com> Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Add a SHM format converter classJorgen Lind2015-02-052-1/+9
| | | | | | | | | | | | | | | | | | This class helps keeing one lookuptable for server and client It relies on that wayland-(client|server)-protocol.h being included before the qwaylandshmformathelper.h Change-Id: I12158126a80c8fef5c52427d35792f33716020f1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Update the protocol to 1.4 and raise the required libwayland versionGiulio Camuffo2015-02-037-1/+26
| | | | | | | | | | | | | | | | Wayland 1.4 introduces wl_subsurface which is quite an important addition. Change-Id: I48375f60adce556c9989872319f4d073e4a7b13b Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-293-4/+5
|\| | | | | | | | | | | | | | | 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>
* | Merge branch '5.4' into devGiulio Camuffo2014-11-1523-68/+87
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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