summaryrefslogtreecommitdiffstats
path: root/src/compositor
Commit message (Collapse)AuthorAgeFilesLines
* rework key handlingGatis Paeglis2019-04-172-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Document the magical 8 keycode offset in QKeyEvent::nativeScanCode() - Check if we are working with the expected keymap format. - Rename sendKey() to handleKey() as that is typical naming convention for events that are passed to QWindowSystemInterface. - WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP is in the bundled xml so use it in send_keymap() - Rename toWaylandXkbV1Key() to toWaylandKey() as previous name was incorrect. - Remove "Generic fallback" in keyboard_key() as it was non-functional, you can't expect any useful output when mapping scan code directly to Qt::Key. It was not working in 5.9 (did not check beyond that) and no one has complained. It is safe to assume that the fallback code path is dead and can be dropped. To use HW keyboard with wayland, you need to build with libxkbcommon. We require this on XCB since Qt 5.1.0, so it is not an unreasonable requirement for Wayland. - Cleanup auto-repeat key handling. - Cleanup "#if QT_CONFIG(xkbcommon)" checks. Change-Id: Ie9fcc628621487fb58bc55dd595bf0d51eedfc92 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* xkbcommon: replace deprecated APIsv5.13.0-beta3Gatis Paeglis2019-04-161-4/+4
| | | | | | | See xkbcommon/xkbcommon-compat.h Change-Id: I2a70e14481db227fc0be657fbcf4f6550d62e7e8 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* compositor: rework xkb context/keymap/state handlingGatis Paeglis2019-04-165-52/+68
| | | | | | | | | | | | | - Use smart pointers from xkbcommon_support-private. - Avoid unnecessary strdup()/free() calls. - Don't recreate context. And move it into qwaylandcompositor so it can be shared between seats. It contains things like a logging level and include paths. Change-Id: Ibea29f2874cc147a8e08f15192831fa42ca58f48 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* [docs] Some edits to match the Wayland and Qt overview documentationv5.13.0-beta2Kavindra Palaraja2019-04-091-61/+49
| | | | | | | | | * Updating this topic to only mention QtWayland. The general Wayland overview is now moved to "Wayland and Qt". Task-number: AUTOSUITE-679 Change-Id: Ica86edc3ffd162ea722fd97e2b47a18d702bb463 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Compositor: Don't destroy wl_display from platform integrationJohan Klokkhammer Helsing2019-04-082-2/+8
| | | | | | | | | If the platform integration provides the wl_display, it should be the platform integration's responsibility to destroy it as well. Task-number: QTBUG-74879 Change-Id: I18999a5bd8cdc2900cac86f156f2adaaebf86158 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-065-6/+10
|\ | | | | | | Change-Id: I16bc2e214dda4c8d6c9fc3568af60068815fc558
| * compositor: fix QWaylandShell private objects inheritanceChristophe Chapuis2019-04-035-6/+10
| | | | | | | | | | | | | | | | | | | | If the public API has inheritance relationships, this should be reflected in the private classes too. Otherwise the d_func will cast to a wrong type, leading to crashes. Change-Id: Iad2dccad4b63326e6b108a44c708ab51f0784678 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | docs: Fix qdoc warningsKavindra Palaraja2019-03-274-3/+103
| | | | | | | | | | | | | | * Added some missing documentation Change-Id: I214b108c084aeff501bed85845153aa80fa61e6d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Fix documentation for bufferLocked propertySimon Hausmann2019-03-191-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2824a71e5c28ec1843edc056f2c17c6274378f1d silenced the qdoc warning about the bufferLocked property, but it did not fix the underlying problem that the existing documentation would be shown. This patch reverts the change and fixes it by making the \property command match the name of the property, not the getter. Similarly, the \qmlproperty annotation was missing entirely. Change-Id: I66281ea4df0162b14ebfab15f1cc18162ea0e8ef Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | [docs] Fix qdoc warningsKavindra Palaraja2019-03-194-9/+10
| | | | | | | | | | Change-Id: I57e89057a238064e1270d036b656d261b85e50e7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | [doc] Fix mismatch in function signature to address a qdoc warningKavindra Palaraja2019-03-191-1/+1
| | | | | | | | | | | | | | * In the header file, this was uint32_t Change-Id: I5c2e343a2f8ec04b71ef4db577062b5c76f64c72 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-161-0/+3
|\| | | | | | | Change-Id: I6d63f7390a3d26ce8c63c8e5de63b673d6831395
| * Compositor: Call eglUnbindWaylandDisplayWL when destroying the compositorJohan Klokkhammer Helsing2019-03-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If unbind is not called, some drivers may try to do cleanup that depends on a valid wl_display in eglTerminate. Arguably, this could/should also have been fixed in the affected drivers. There is a display_destroy signal that the driver should listen to, to avoid using dangling wl_display and wl_global pointers. However, by using eglUnbindWaylandDisplayWL we can force the cleanup to happen before wl_display_destroy. Which is what this patch does. Change-Id: Id9062de896b723838bcecac3902031e6b172a6de Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Compositor: Fix incorrect texture size for client buffers when dpr > 1v5.13.0-beta1Johan Klokkhammer Helsing2019-03-111-1/+2
| | | | | | | | | | | | | | | | | | The old implementation used QQuickItem::width and height, which changes with the devicePixelRatio. We now use the new property, QWaylandSurface::bufferSize, instead, which is the actual pixel size of the buffer. Change-Id: I430f46746ed2b8f0330e0d220718f58004b3bd2e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Add missing WaylandSurface::bufferSize propertyJohan Klokkhammer Helsing2019-03-071-1/+2
| | | | | | | | | | | | | | ...and also add revision info for the bufferSizeChanged signal. Change-Id: I2b8e9bea7cafc70c078e74b191c3c87b322ff216 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Compositor: Add revision number for new APIJohan Klokkhammer Helsing2019-03-052-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Revisioning API in QML serves two purposes: - Making sure QML code developed against an older version of Qt doesn't change its behavior when run with newer versions. This can otherwise happen due to QML being interpreted, and QML's liberal scoping rules. - Allowing developers to target an older version of Qt, but developing a newer version by explicitly asking for an older import. Change-Id: I837cd449028c4b84c33afa97bcf6c1149801facd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Add missing version information for new APIJohan Klokkhammer Helsing2019-02-272-0/+22
| | | | | | | | | | Change-Id: Ieec4a97d901f236d2cec003d8b35e2f95b1b2aea Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-261-0/+1
|\| | | | | | | Change-Id: I4c99725971d7c15448ca3f01306ae869af9ef057
| * Fix the build with -no-guiLiang Qi2019-02-251-0/+1
| | | | | | | | | | | | Change-Id: I9ff6ac4e33e89691e06965515a54e91a831b7a0a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-091-2/+2
|\| | | | | | | Change-Id: I1b00775ff2d9ede97dbcd9f9deb9f2a947cf1ae5
| * Doc: Fix wrong link to isBufferLockedNico Vertriest2019-02-071-2/+2
| | | | | | | | | | | | Change-Id: I5024e50af6e403e9373181948b36548bc0862f9b Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Add deprecated support for wl_scalerJohan Klokkhammer Helsing2019-01-244-0/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Compositor] Add deprecated support for the deprecated wl_scaler. Some clients are stuck on the unofficial Weston protocol wl_scaler instead of the standardized and stable wp_viewporter. This implements optional support for wl_scaler. This patch has been written to be easily removable in Qt 6, and touches a minimal amount of other code. The implementation can be tested using the new manual test compositor: tests/manual/wlscaler. Weston 1.11.1 has a demo client named weston-resizor, which can be used to test. Note that although newer versions of Weston also have weston-resizor, those versions use wp_viewporter instead of wl_scaler, so you really need 1.11.1 or earlier to test. Fixes: QTBUG-69635 Change-Id: Id572e28044cd764eaf63b1259a92bc589711c39d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-223-4/+1
|\| | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/3rdparty/protocol/qt_attribution.json src/client/qwaylandintegration.cpp Change-Id: I475889f2817c7094b68a2948fdd34ddf8b0c486f
| * Merge remote-tracking branch 'qt/5.12.1' into 5.12Paul Olav Tvete2019-01-211-1/+1
| |\ | | | | | | | | | Change-Id: I6ca92b605c55b0c8941d42e40fad624f00a65cd3
| | * Fix flickering (black frames) of wayland clients on NVIDIADominik Holland2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the threaded render loop rendering the texture we acquired from the eglstream is done in a different thread. This rendering needs to be finished before the next acquire call for the eglstream is done otherwise we might end up rendering a broken (black) frame and see the client flicker. To fix this, make sure to send the frame callbacks after the rendering was completed and not before the rendering starts. Change-Id: I5a75914d14d2df7fa8b6bbd526f87e3ef6208cd6 Task-number: QTBUG-71697 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * | Remove stray surfaceDestroyed() declarationPier Luigi Fiorini2019-01-181-1/+0
| | | | | | | | | | | | | | | Change-Id: I1a23d6ab5a455603990db269446c15a012c0f879 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | Remove unimplemented QWaylandCompositor::createSurfaceViewJohan Klokkhammer Helsing2019-01-181-2/+0
| |/ | | | | | | | | | | | | | | Seems like it was just a left behind by mistake in fffa0f76 back in 2011. Fixes: QTBUG-73070 Change-Id: I3055d2c72cd6752de9917d765684ff049c0dbc6c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Compositor xdg-shell: Warn when clients supply invalid anchor rectsJohan Klokkhammer Helsing2019-01-182-10/+28
| | | | | | | | | | | | | | | | | | | | | | From the protocol: "When the xdg_positioner object is used to position a child surface, the rectangle may not extend outside the window geometry of the child's parent surface." Adds a warning for both v6 and stable when clients do this. Change-Id: I575a89785f45c080d488be748ec099569b38ea9b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Client: Initialize m_retainedReadIndexJohan Klokkhammer Helsing2019-01-181-1/+1
| | | | | | | | | | | | Change-Id: I9ae028cda8f8a874eb8379f16a9ef7facf0ed85d Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Clean up .gitignorePier Luigi Fiorini2019-01-171-0/+3
| | | | | | | | | | | | | | | | | | Ignore more files resulting from the build process. Glob all scanner generated files, and add exceptions for pregenerated files. Change-Id: Ica60951356bdc145ebd66f5e6fc6bf4e23f2aa72 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Emit a signal when WaylandQuickItem.compositor changesJohan Klokkhammer Helsing2019-01-172-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes warnings like: QQmlExpression: Expression qrc:/Chrome.qml:13:5 depends on non-NOTIFYable properties: Chrome_QMLTYPE_28::compositor [ChangeLog][Compositor] Added a missing change signal for WaylandQuickItem.compositor. Change-Id: I9f372c46778d0851a82a8dcbb0751a0e12f825b1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Member init for some variables that are not covered by constructorsJohan Klokkhammer Helsing2019-01-164-8/+8
| | | | | | | | | | | | | | Where it makes sense, default init variables to sensible values Change-Id: Ie2aa6ab79a6a3c8322bb0ff804f340f7ffd1c1d1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Compositor: Implement support for the viewporter extensionJohan Klokkhammer Helsing2019-01-029-2/+458
| | | | | | | | | | | | | | [ChangeLog][Compositor] Added support for the viewporter Wayland extension. Change-Id: I1d33652fab6ff18da4ae1ae3497f0ca43517420a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-227-21/+34
|\| | | | | | | | | | | | | | | Conflicts: README src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri Change-Id: I7cbbf39916821f0f1749e3ccab3151f68f4aa1ac
| * Compositor: Fix crash in QWaylandSurface::waylandClientJohan Klokkhammer Helsing2018-12-222-1/+14
| | | | | | | | | | | | | | | | Adds a test for customSurface which crashed without the fix. Fixes: QTBUG-72688 Change-Id: I30c50e474379c61b90b2dd294eae9a7c88c105a2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * Fix invalid QWaylandOutputMode comparison operatorJędrzej Nowacki2018-12-061-2/+2
| | | | | | | | | | | | Fixes: QTBUG-72288 Change-Id: I61fde92ea4275febbb4ec8c067280a4ca570d7c1 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * use new feature name xkbcommon_evdev -> xkbcommonGatis Paeglis2018-12-054-18/+18
| | | | | | | | | | | | | | | | | | The xkbcommon configure logic was refactored in qtbase/c3a963da1f9e7b1d37e63eedded61da4fbdaaf9a. For more details see the relevant commit. Change-Id: Ic1aa26846ab8266c589f6e92dc8b81aba36df58a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Implement linux-dmabuf-unstable-v1Andreas Cord-Landwehr2018-12-132-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Compositor] Added support for linux-dmabuf-unstable-v1. Implement client side DMABUF buffer sharing support by supporting the linux-dmabuf-unstable-v1 (version 3) protocol. For enabling DMABUF, set the following environment variables for the compositor: QT_QPA_PLATFORM=eglfs QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=linux-dmabuf-unstable-v1 The current implementation supports the following DRM buffer formats: - RGB and RGBA - YUYV This implementation requires Mesa with the following patch applied. Otherwise, textures are not updated. The patch is contained in Mesa 18.1.5. See https://patchwork.freedesktop.org/patch/238080/ Fixes: QTBUG-66288 Fixes: QTBUG-67845 Change-Id: Id4d90337dbe0be956b0f964426ebed3f281c6c30 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-12-054-11/+25
|\| | | | | | | | | | | | | Conflicts: src/compositor/compositor_api/qwaylandquickitem.cpp Change-Id: I5e01a0731e880e3eb8eab349043756a5993e3050
| * Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-12-051-1/+3
| |\ | | | | | | | | | Change-Id: Ica38060e6d624a7534660eabec604f6795970c95
| | * Don't crash if view is deleted from surfaceDestroyed signalv5.12.0-rc2v5.12.0-rc1v5.12.0Paul Olav Tvete2018-11-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix regression introduced in 297bcd005c4205f69e1bf9e9dc565ab757cf0bac Fixes: QTBUG-71643 Change-Id: I769518a9ca13fcd13ea277c7fa8ac1885ca123ba Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | Fix compilation with gcc 4.8Ville Voutilainen2018-12-043-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.8 doesn't like QPointers in signal connections. Also, Default Member Initializers for aggregates are C++14, so we need to write a constructor to make a class with DMIs work in C++11. Change-Id: I567c60a8081fa2f268517ec747bd6534674bcce5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-041-0/+1
|\| | | | | | | | | | | Change-Id: I29192963efa6753a4cf222a3aec92ab400deb2f0
| * | Fix build due to missing QDebug includeSergio Martins2018-11-301-0/+1
| |/ | | | | | | | | | | | | Build was failing on Archlinux Change-Id: I3cf9a367a099cd365a2de6579c7ef5585cd9be56 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Add convenience for converting wl_resource * to wrapper typesJohan Klokkhammer Helsing2018-11-2113-42/+119
| | | | | | | | | | Change-Id: Ieb2f9706ac707ff878165d3f9001e4a28b8ff1ce Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Add QWaylandSurface::bufferSize and deprecate sizeJohan Klokkhammer Helsing2018-11-162-11/+47
| | | | | | | | | | | | | | | | | | | | | | | | Size is confusingly returning the surface size in buffer coordinates and not surface coordinates. Create a new property bufferSize and deprecated size in order to make it less ambiguous. [ChangeLog][Compositor] QWaylandSurface::size has been deprecated. Use bufferSize or destinationSize instead. Change-Id: I7985e4cc1b8d627f922680c1800d2687d710d7b3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Compositor: Fix coordinate system inconsistenciesJohan Klokkhammer Helsing2018-11-1612-54/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several properties were using pixel coordinates and surface coordinates without converting. [ChangeLog][Compositor] QWaylandSurface::destinationSize has been added which returns the size of the surface that will be displayed on the screen in surface coordinates. [ChangeLog][Compositor] Fixed a bug where QWaylandSurface::inputRegionContains would return true for some points outside surfaces with buffer scale > 1. [ChangeLog][Compositor] Fixed a bug which caused ShellSurfaceItems for surfaces with buffer scale > 1 to move too much when resizing interactively. It also gets rid of all calls to QWaylandSurface::size, which confusingly returns the size of the surface's buffer in pixel coordinates. Most properties now use destionationSize's surface coordinates consistently. Hopefully, QWaylandSurface::size can be renamed or removed in Qt 6. Change-Id: I007256a8df7759cf74fbfd51624fa1f90c083336 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-302-1/+12
|\| | | | | | | Change-Id: I1d9281750b06f7584e55759994dc6fcbcc5b2455
| * Compositor: Add const version of QWaylandQuickItem::inputRegionContainsJohan Klokkhammer Helsing2018-10-222-1/+12
| | | | | | | | | | Change-Id: I649149e2cee24f8296bf24a22ee8bb865feea9c6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-202-50/+40
|\| | | | | | | Change-Id: I36baa27b69b755f81de9cda94113d338f06c34a1