summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Client: Always close popups when hiding a windowJohan Klokkhammer Helsing2020-01-041-2/+1
| | | | | | | | | | | | | | | | It's not just popups that may have popups open on them. Always close open popups when hiding a window to prevent dangling pointers. [ChangeLog][QPA plugin] Fixed a crash when re-showing a popup after hiding its parent. Fixes: QTBUG-80562 Change-Id: I7cdac5c7a30e0add5ebf00259401e4d74626ce96 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 7c0833f4bc22d2d947c793f0711e3f1e1a09012c) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Stop using modern C++Johan Klokkhammer Helsing2020-01-041-1/+1
| | | | | | | | | | Fixes compilation errors with c++11. Fixes: QTBUG-81024 Change-Id: I13ae380a122a2d52b7b362a7a39e661a22c74afc Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> (cherry picked from commit f7e035446355d9cb90141e508b5d33e019e14add) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix touch being ignored when down and motion are in the same frameJohan Klokkhammer Helsing2019-11-061-1/+4
| | | | | | | | | | | The Wayland protocol gives no guarantees about which events are part of a frame, so handle the case where we receive wl_touch.down and wl_touch.motion within the same frame. Fixes: QTBUG-79744 Change-Id: I5dd9302576d81da38e003c8e7e74da6a98def603 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 57c28f461a066c03ef8ae3f823c040fa91876fb8)
* Client: Fix crash when showing a child window with a hidden parentJohan Klokkhammer Helsing2019-11-052-3/+8
| | | | | | | | | | | | | [ChangeLog][QPA plugin] Fixed a crash when showing a window with a hidden parent. Now we just avoid creating the subsurface, so nothing is shown. Seems to be the same behavior as on xcb. Fixes: QTBUG-79674 Change-Id: Ia46fcd9a0da5aad4704816a41515cb1e128ac65f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 962b9be7992cef672cb6307af5653c97382c334f)
* Compositor: Fix crash when trying to maximize an XdgToplevel with no outputJohan Klokkhammer Helsing2019-10-281-4/+12
| | | | | | | | | | This cherry-pick also fixes a shadowed, unused variable introduced in the original commit. Fixes: QTBUG-78969 Change-Id: I4ecde3725b5307251070e331c97d96df328a3772 (cherry picked from commit 11f2e7df5762a23e66d1755b34f5f3d07208ae32) Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Fix 100ms freeze when applications do not swap after ↵Johan Klokkhammer Helsing2019-10-222-38/+9
| | | | | | | | | | | | | | | | | deliverUpdateRequest [ChangeLog][QPA plugin] Fixed a 100 ms freeze that would occur if applications did not draw after receiving a deliverUpdateRequest(). QtQuick does this at the start of animations. This should get rid of those backingstore warnings (and also remove a 100ms freeze before animations start in those instances). Fixes: QTBUG-76813 Change-Id: Id366bf4a14f402fa44530ae46e7b66d9988c14f6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: John Brooks <john.brooks@qt.io> (cherry picked from commit 9f5b96225885f927727a57b6123d8550d6c373bb)
* Client: Don't crash with long window titles using UTF-16 charactersJohan Klokkhammer Helsing2019-09-251-2/+4
| | | | | | | | | | | | | | | Previously, we set the max length in QString character length, which means UTF-16 characters (of potentially three bytes) counts as one character. The max limit of libwayland, however, is in bytes (and the string itself is converted to UTF-8). Fix it by dividing the character limit by three because in the worst case each UTF-16 character will use three bytes when UTF-8 encoded. Fixes: QTBUG-78478 Change-Id: Idf4721894e0fe6f3cd92bdc6ada7b0ea4199ea63 (cherry picked from commit 1ed0782e93dafb0a3d5ef3a02c9c3999825817ee) Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix detection of wayland-kms supportYuya Nishihara2019-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We get around the "private" symbol found in wayland-kms.h by substituting it with "priv", but doing that breaks the "private:" keyword in type_traits.h. So this patch forcibly includes math.h prior to s/private/priv/. main.cpp:3:17: error: ‘priv’ does not name a type #define private priv ^ In file included from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/cmath:43:0, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/math.h:36, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-util.h:34, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-server-core.h:32, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-kms.h:38, from main.cpp:4: /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/ext/type_traits.h:71:24: error: ‘__if_type’ has not been declared typedef typename __if_type::__type __type; ^~~~~~~~~ main.cpp:3:17: error: ‘priv’ does not name a type #define private priv ^ In file included from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/cmath:43:0, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/math.h:36, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-util.h:34, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-server-core.h:32, from /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/wayland-kms.h:38, from main.cpp:4: /opt/poky-agl/5.0.3/sysroots/aarch64-agl-linux/usr/include/c++/6.3.0/ext/type_traits.h:114:24: error: ‘__if_type’ has not been declared typedef typename __if_type::__type __type; ^~~~~~~~~ Change-Id: I2b42f37d5565833adcc065725119ab4912da82b0 (cherry picked from commit 382e3292aa0eb6addac84ddefeedc98c7f3b41b2) Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Fix touch rounding errorsJohan Klokkhammer Helsing2019-09-102-7/+13
| | | | | | | | | | | Touch now accounts for fractional input in the same way as for pointer input. Task-number: QTBUG-77457 Change-Id: I18e633bf7c7033187a641f757b8b24f52479971a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit b1a534a536892035fdf1e826a066bda6ab34b93a) Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Merge remote-tracking branch 'origin/5.12.5' into 5.12Qt Forward Merge Bot2019-09-072-1/+12
|\ | | | | | | Change-Id: Ic73262146f51a9e7f4ffab46511654ad70c4f514
| * Merge remote-tracking branch 'qt/5.12' into 5.12.5Paul Olav Tvete2019-08-237-31/+39
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I89fefe5bfc247eeaad3981850efa0faaab3cb145
| * | Client: Make handleUpdate aware of exposure changesDavid Edmundson2019-08-212-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wl_surface can be destroyed whilst a render is happening. Calling wl_surface::frame after the window is reset can crash as wl_surface is null. Fixes: QTBUG-77747 Change-Id: I139a9b234cb6acba81d6c1d5fa58629904a25053 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Compositor: Fix various input-related rounding errorsJohan Klokkhammer Helsing2019-09-064-15/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPointF::toPoint (which is what the QPoint versions of the events use internally) uses qRound, which is not the right kind of rounding to use with the QRegion we use for the input region. This switches to use QPointF variants instead of QPoint wherever possible, and then the correct conversion (with qFloor) is done once in the new QPointF version of QWaylandSurface::inputRegionContains(). The compositor inputRegion test has now been updated to test the new API. [ChangeLog][Compositor] Fixed various rounding errors related to touch and mouse input. Fixes: QTBUG-77457 Change-Id: Ife2365abd56a239c34eee91310ab0e698a50d4ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 7f189ec10a9b3e9825dda30d3a8f86ee2e07b97f) Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | Fix deadlock in QWaylandWindow::waitForFrameSyncPavel Tumakaev2019-09-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling the QOpenGLContext::swapBuffers from QGuiApplicationPrivate::processExposeEvent in some cases leads to recursive calls of QWaylandWindow::waitForFrameSync. Since the mWaitingForFrameCallback check in WaylandWindow::waitForFrameSync is performed after the mutex is locked, the QMutexLocker tries to lock the mFrameSyncMutex mutex in every recursive call, that leads to a deadlock. This patch moves the performing of the mWaitingForFrameCallback check before locking the mutex. Change-Id: Ia2d834b7dd03fcd91bbe29a3a897b4db2d155527 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Client: Refactor touch handling and fix various bugsJohan Klokkhammer Helsing2019-08-292-60/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename mTouchPoints to mPendingTouchPoints, to clarify that they're the accumulated state so far, which will be applied with the wl_touch.frame event. QWaylandInputDevice::Touch::mPrevTouchPoints is no longer needed and has been removed. Fixes the following issues with the old approach: - touchPointsReleased() only checked mTouchPoints, which was cleared on touch_frame and populated again on touch_motion and touch_down, which meant that it could return true even though there were still touch points left. Leading to the workaround for missing wl_touch.frame events on Weston being triggered to often. - Touch focus was cleared on any wl_touch.up event, not just the last one. - The order of the touch events was not stable and relied on the order of the events (QTBUG-77014). Fixes: QTBUG-77014 Change-Id: Ic3ecdc87e77b0e0276afefd127ad2b965142cbd4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Client: Don't freeze in QDrag::exec if there was no drag focusJohan Klokkhammer Helsing2019-08-293-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | af00b801 fixed a crash when starting a drag without a valid focus, but there is still a problem, because QDrag::exec will never return because it's waiting indefinitely in an event loop. - QWaylandDataDevice::startDrag can now fail by returning false. - When starting a drag fails, we cancel the drag through QWaylandDrag::cancelDrag wrapped in invokeMethod. - Also, don't unnecessarily create a data_source if we cannot start a drag. [ChangeLog][QPA plugin] Fixed a freeze that happened when starting a drag-and-drop operation without a valid source surface. Change-Id: Iea19b0c92c196a44d1274a966bee4ff519632d34 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Make QT_WAYLAND_COMPOSITOR_QUICK a featureUlf Hermann2019-08-2916-28/+29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The define was only set when building Qt, not when including public headers in application code. Therefore, the sizes of objects did not match between the client code that calls new and the constructor inside Qt. Unfortunately, adding the additional members breaks binary compatibility. This has already happened between 5.11 and 5.12. It just wasn't apparent from the headers. If we removed the members again now, we would break binary compatibility again. Therefore, the best course of action seems to be acknowledging the break and adding the members also in the headers. [ChangeLog][Compositor][Important Behavior Changes] Between version 5.11 and 5.12 binary compatibility for the wayland compositor module was broken by adding an additional member to various classes. This was not apparent from user code as the member was behind an #ifdef which would only be set while compiling Qt. As several versions of Qt incompatible to 5.11 have already been released now, rolling back the incompatible change would introduce further incompatibility. Therefore, the change is made consistent by unconditionally adding the member to the headers. Fixes: QTBUG-75677 Change-Id: I3c1ee309ad8e0cd0b6389a76fd1d91e6e2be495c Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Crash instead of exit when there's a wayland errorJohan Klokkhammer Helsing2019-08-222-17/+6
| | | | | | | | | | | | | | | | Qt applications should not call exit. Task-number: QTBUG-75779 Change-Id: I91190b10f8c8e111996cd73283061e6ceaa6b1f6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Handle Key_Return explicitly instead of depending on the textAndy Shaw2019-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | When Key_Return is sent from Qt VirtualKeyboard it will send it as \n and not \r which means it will be interpreted as an unknown key. So since we know it will be able to map it in this case, we explicitly account for it so it can be mapped to the right key. Change-Id: Id5d8d9653e78975203f80790b7a3d332f0e011fa Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Fix race condition for client buffer integration initializationJohan Klokkhammer Helsing2019-08-202-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This race happened because QWaylandIntegration::clientBufferIntegration (which lazily initializes the integration) was called from numerous places including code that may run on different threads without any kind of syncrhonization. An example of this is Qt3D, which indirectly and simultaneously calls createPlatformWindow (from the GUI thread) and createPlatformOpenGLContext (from its render thread), both of which needs to use the client buffer integration. In this patch, we fix it by first checking if the integration is initialized. In that case, it's safe to use it. Otherwise we lock a mutex, re-check if initialization has happened on another thread in the meantime, and then finally we initialize it. This way we should avoid the expense of mutex locking after initialization is complete, while still staying race free during initialization. Fixes: QTBUG-76504 Change-Id: I327840ebf41e014882cb659bc3e4fafb7bdb7a98 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Emit wl_surface lifetime signals on QWaylandWindowJohan Klokkhammer Helsing2019-08-192-1/+9
|/ | | | | | | | | | | | | | | | | | | | | | | Recent changes in QtBase means QtWayland will have to follow the convention of the rest of the QPA plugins and have QPlatformSurfaceEvent::SurfaceCreated and SurfaceAboutToBeDestroyed follow the QPlatformWindow (QWaylandWindow) lifetime and not the lifetime of wl_surface. Some users were depending on those events to get notified about wl_surface changes and used QPlatformNativeInterface in order to get the window's underlying wl_surfaces in responses to the events. The good news is that QPlatformNativeInterface is private (QPA) API, so we can provide an alternative by exposing new private API, which is what this patch does. The QWaylandWindow::wlSurfaceDestroyed signal already exists in the dev branch (introduced in eb66211ea9), so this is a backport of that signal as well as an addition of a new QWaylandWindow::wlSurfaceCreated signal. Task-number: QTBUG-76324 Change-Id: Ibc5748474cd52f5b9461fd1ad6cef973491174b1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Fix large clipboard pastingDavid Edmundson2019-08-171-16/+25
| | | | | | | | | | | | | | With the non-blocking file opening, when no data was available in the pipe, read could return 0 even though we were not at the end of the file. This resulted in truncated data when pasting the clipboard. This patch uses select to block until a file is available, removing the polling sleep. This means the file can be safely opened in blocking mode whilst keeping the timeout feature allowing read to work as intended. Change-Id: I936aa85e9f25197e7abe6fb3fa729b618c00924d Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix incorrect conversion to straight alpha pixel formatsJohan Klokkhammer Helsing2019-08-171-11/+20
| | | | | | | | | | | | | | | | | | | Previously, QWaylandSharedMemoryFormatHelper::fromWaylandShmFormat(WL_SHM_FORMAT_ARGB8888) would return Format_ARGB32, i.e. the non-premultiplied version, while, according to the wayland-devel mailing list (https://lists.freedesktop.org/archives/wayland-devel/2017-August/034791.html), all Wayland RGB-based pixel formats with alpha should have premultiplied alpha. This patch makes sure we return the premultiplied variants for ARGB8888, as well as for ABGR8888. Using a switch instead of the array also allows us more freedom to choose the preferred format in other cases where multiple QImage formats map to the same wl_shm format. While being wrapped and exported as QtWaylandClient::QWaylandShm::fromFormat (private API), this conversion function doesn't seem to be used anywhere, so this patch shouldn't cause any changes in behavior for projects that only use public API. Change-Id: Ie09f9a339b4540dd0383a72b3c951eb8c93e3ab4 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Add safer fromObject function to scannerJohan Klokkhammer Helsing2019-08-155-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | Makes the scanner produce generated static functions such as QtWaylandClient::wl_surface *wl_surface::fromObject(struct ::wl_surface *object); Which casts from the wayland-scanner generated types, such as struct ::wl_surface *, to types types generated by qtwaylandscanner, but performs a check to see if the listener is set to the wrapper class first (at least for interfaces with events). This lets us easily fix crashes in a couple of places where we receive events with wayland objects that we didn't create. Also adds nullptr checks whenever we use the fromWlSurface() and fromWlOutput() functions to handle failed conversions. Task-number: QTBUG-73801 Fixes: QTBUG-74085 Change-Id: I9f33c31c7d1a939ccb3ebbbcb0eb67af10037237 Reviewed-by: Jaroslaw Kubik <jarek@froglogic.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 3eea45e31ef796ab6f1363f8fd2882c151becc20) Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Backport texture sharing for NVIDIAPaul Olav Tvete2019-08-1337-7/+3439
| | | | | | | | | | | | | | | | | | | | | | | | | This commit backports the Vulkan server buffer and texture sharing code from Qt 5.14 to Qt 5.12 as an opt-in feature. To enable, configure with "-feature-wayland-client-texture-sharing-experimental -feature-wayland-compositor-texture-sharing-experimental" Contains code from the following commits: Add server buffer integration based on Vulkan (commit df3a1761af2f20d59ae09a7adaa2f5b959047687) Compressed texture support for vulkan server buffers (commit f710489a341713c675cfd91d22ccd7bf8f29f4dd) Implement server-side toOpenGlTexture for Vulkan (commit 19361e7259f04b08925b1e8e99faf9460770ee7b) New texture sharing protocol and infrastructure (commit 80001cbf0451f4ba2a971fb20b80dc8e25ac604d) Change-Id: I6c36ef7fddcd4db39e80d03a822d89f15eae3434 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix expose event compressionPaul Olav Tvete2019-08-132-1/+4
| | | | | | | | | | For shells that do not send configure events when exposed: If setGeometry() was called before the window was initialized, Qt would not mark the window as mapped, and the window would never become visible. Change-Id: Ic933cbbff20702424129c11264215181330cc7d1 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix compilation with C++20Marc Mutz2019-07-081-4/+4
| | | | | | | | | Implicit capture of 'this' in [=] is deprecated in C++20. Fix by using explicit captures. Change-Id: Ie3a94ec60d7c56b2856d201fa3d68d0670bdd7b9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Client: Reset frame callback timer when hiding a windowDavid Edmundson2019-07-011-0/+7
| | | | | | | | | | | | | If we hide a window whilst a compositor has a pending frame to show, it's possible the compositor will not render the frame and not return the callback. If this happens on the next window expose we can be left with mFrameCallbackTimedOut still true causing isExposed() to remain false and us to not send the next buffer when we later show the window again. Change-Id: I507410415d1a930fd5fa736412055e68fdf6c1d3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Client: Fix stuttering when the GUI thread is busyJohan Klokkhammer Helsing2019-06-202-29/+32
| | | | | | | | | | | | When we did invokeMethod for handling the frame callbacks, we had to wait for the GUI thread to finish whatever it's doing before we would stop blocking. Fix it by clearing the frame callback timer and stop blocking immediately, while delaying the rest of the work until it can be run on the other thread. Fixes: QTBUG-76397 Change-Id: I343e4feac4838926b4fa2ccac2948988bc6c3bb7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't crash if we start a drag without dragFocusAleix Pol2019-06-141-1/+4
| | | | | | | | | | | Sometimes origin will be nullptr, triggering a crash. [ChangeLog][QPA plugin] Fixed a crash that sometimes happened when starting a drag-and-drop operation. Fixes: QTBUG-76368 Change-Id: I8f4e6b05f073644834c3c72a8307dac5b897f626 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Client: Don't add all windows to activePopupsJohan Klokkhammer Helsing2019-06-051-1/+1
| | | | | | | | | | | | | | | Neither Qt::ToolTip nor Qt::Popup are single bits in Qt::WindowFlags, and do in fact include Qt::Window. This meant that when we or'ed them and did a bitwise and with QWindow::type(), we would match more types than just Qt::Popup and Qt::ToolTip. We would for instance get any Qt::Window as well, which meant the main window would be added to activePopups, leading to strange things happening, such as crashes and the main window closing unexpectedly. [ChangeLog][QPA plugin] Fixed a crash when closing multiple popups at once. Fixes: QTBUG-76124 Change-Id: I1a6a59e161a436604a7ac8ab824396481dc99a20 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Map touch ids to contiguous idsJohan Klokkhammer Helsing2019-05-222-1/+20
| | | | | | | | | | The protocol doesn't require this, but some clients seem to depend on it nevertheless. Fixes: QTBUG-75667 Change-Id: I47491c396d3c9193c7e51e13c7ca1586246e335c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 869a38c082daf150a16b2abb230b420de3e4af31)
* Fix compile error with -no-openglJohan Klokkhammer Helsing2019-05-291-0/+2
| | | | | | | | | | | [ChangeLog][Compositor] Fixed a build error when configured with -no-opengl. This is the same fix as in dev's 8663de3f, but leaves the QML APIs disabled. Fixes: QTBUG-76104 Change-Id: I9807144e0c0cf33d421c7c6adcb2664e1e67368c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Docs: Fix incorrect version for module importJohan Klokkhammer Helsing2019-04-301-2/+2
| | | | | | | | | | | | This fixes an issue with the XdgShell documentation where the import statement at the top was too low (1.1 instead of 1.3) Later we should make it automatically follow the Qt minor version (see QTBUG-74042). Fixes: QTBUG-73256 Change-Id: Ib280998fe9c65168854e517b8555c5cd9b17cdd7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Full implementation for frame callbacks (second try)Johan Klokkhammer Helsing2019-04-247-49/+218
| | | | | | | | | | | | | | | | | | | | | | | | | The Wayland plugin now takes full control over delivering update request and implement frame callbacks for both egl and shm. [ChangeLog][QPA plugin] The non-blocking version of eglSwapBuffers is now used, if supported. This fixed a bug where minimized windows would block the event loop. [ChangeLog][QPA plugin] Windows that don't get frame callbacks from the compositor within 100 ms are now set as not exposed. This should stop most clients from rendering unnecessary frames to minimized or hidden windows. Also, when we relied on the QPA version of requestUpdate, we would sometimes deliver one update request while we were waiting for a frame callback. When we implement the fallback timer ourselves we can make sure we only deliver the fallback if there are no pending frame callbacks. QtQuick and other applications often depend on blocking swapBuffers to throttle animations. If the context's surface format has a non-zero swapInterval, try to emulate a blocking swap. Fixes: QTBUG-69077 Change-Id: I3c6964f31a16e9aff70b8ec3c5340e640a30fef2 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Compositor: Add qwaylandoutput_p.h to headersJohan Klokkhammer Helsing2019-04-241-0/+1
| | | | | | Fixes: QTBUG-75329 Change-Id: Ifdd93e28ebf971ab10f7d051c2da56d115f2068b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor: Fix compilation problems for qwaylandshell.hJohan Klokkhammer Helsing2019-04-172-2/+26
| | | | | | | | | | | d65783c broke compilation for code that includes qwaylandshell.h, but not qwaylandshell_p.h, because QWaylandShellPrivate is an incomplete type and we don't know that it's convertible to QWaylandCompositorExtensionPrivate by just looking at the public header. And we can't move the QWaylandShellTemplate constructors to the cpp file because it's a template class. Change-Id: Ia2d093de74429ace33d08b91743cbc8b7e7befa8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix incorrect path to wl-eglstream-controller.xmlJohan Klokkhammer Helsing2019-04-111-1/+1
| | | | | Change-Id: I1d4bceeb87b7e95b7b4b9c9885e06052bd7536e9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Don't be exposed if we want to create a sub or shell surfaceJohan Klokkhammer Helsing2019-04-083-13/+24
| | | | | | | | | Because some shells don't allow attaching buffers before configure, we need to not be exposed until we know that we don't want a shell surface. Change-Id: Ida7101a99f953d02cf6401e4ea8d28cfabd6e102 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* 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>
* Client xdg-shell v5: Fix crash when creating a popup without a valid parentJohan Klokkhammer Helsing2019-04-022-4/+12
| | | | | | Fixes: QTBUG-72696 Change-Id: I43f0a02a4447238aa93142981d22597c452790fd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Fix incorrect damage region for window decorationsJohan Klokkhammer Helsing2019-03-141-5/+10
| | | | | | | | | | | | | The previous implementation had gaps in several places. [ChangeLog][QPA plugin] Fixed a bug where the window decoration's damaged area didn't cover the entire decoration. This meant some compositors would not redraw those areas. Change-Id: Ic72663dde301936635b2a1cfa90570a53227e8ea Fixes: QTBUG-74341 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor: Call eglUnbindWaylandDisplayWL when destroying the compositorJohan Klokkhammer Helsing2019-03-142-0/+11
| | | | | | | | | | | | | | | 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>
* Fix the build with -no-guiLiang Qi2019-02-252-0/+2
| | | | | | Change-Id: I9ff6ac4e33e89691e06965515a54e91a831b7a0a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Client xdg-shell: Fix crash when switching popupsJohan Klokkhammer Helsing2019-02-124-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | The call to flushWindowSystemEvents() sometimes caused new popups to be shown in the middle of hiding another. I.e. if multiple events show and hide surfaces, they would be shown/hidden in opposite order of their corresponding events. QMenus sometimes suffered from this (can be seen with the qopenglwidget example from qtbase). When the flush was added 5 years ago in 50f43a0c5, it was to "reduce the chances of seeing a bad frame". I don't see any rendering artifacts, though, and I can't find any bug report on it. So let's hope it's safe to remove the hack. [ChangeLog][QPA plugin] Fixed a crash that sometimes happened when switching popups. Also adds more info to the workaround warning message that appears when a popup grab is attempted and there already is another grabbing popup that is not the parent. Fixes: QTBUG-73524 Change-Id: Ibfcbb48c4bbe295c2be1a30add2d7e05cad398c5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* 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>
* Merge remote-tracking branch 'qt/5.12.1' into 5.12Paul Olav Tvete2019-01-2116-106/+869
|\ | | | | | | Change-Id: I6ca92b605c55b0c8941d42e40fad624f00a65cd3
| * Fix black client windows when not using window decorations on NVIDIADominik Holland2019-01-081-1/+6
| | | | | | | | | | | | | | | | | | | | QWaylandGlContext::makeCurrent() tries to be smart and only call eglMakeCurrent() if really needed. This causes problems on NVIDIA where the call is always needed. Change-Id: I08d881d69f79a0fd4ea83a65780052e269a566be Task-number: QTBUG-71697 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * 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>
| * Revert "Client: Full implementation for frame callbacks"Johan Klokkhammer Helsing2019-01-083-103/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused regressions because QtQuick depends on swapBuffers for throttling animations. We probably need to emulate a blocking swapBuffers and continue after a timeout, but until we have a patch for this, revert this to avoid releasing a regression. This brings back the bug with a frozen event loop when a surface is waiting for a frame callback, but this is preferable to a regression. This reverts commit 1dc85b95ab0adc1e805d059e2c35c671ef790011. Fixes: QTBUG-72578 Change-Id: If6435a947aae5e9fd775404649a392bfafe9130a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>