summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-121-4/+12
|\ | | | | | | Change-Id: If684b523436a1beec36a137c73c5c39c948f87e3
| * Compositor: Remove unused local variableJohan Klokkhammer Helsing2019-10-041-1/+0
| | | | | | | | | | | | | | | | Was shadowed in 11f2e7df5 when fixing QTBUG-78969. Task-number: QTBUG-78969 Change-Id: I933373b5233ae8b45cdab7c3ffd14a1502486ae8 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * Compositor: Fix crash when trying to maximize an XdgToplevel with no outputJohan Klokkhammer Helsing2019-10-041-3/+12
| | | | | | | | | | | | Fixes: QTBUG-78969 Change-Id: I4ecde3725b5307251070e331c97d96df328a3772 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14v5.14.0-beta1Qt Forward Merge Bot2019-10-011-2/+4
|\| | | | | | | Change-Id: Ie236fa47c23456b15414c3b3e89568b915979ebe
| * 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 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Create context menu event when pressing the menu keyDavid Edmundson2019-09-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | Effectively is a copy of the code in XCB. When the menu key is pressed, a context menu event should be generated at the current cursor position. The global position in the event isn't truly global as that doesn't exist in wayland but should match client expectations. Change-Id: Ib814883aba632ca5eec58730846e1762b680467f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Compositor: Expose QPointF version of inputRegionContainsJohan Klokkhammer Helsing2019-09-162-7/+2
| | | | | | | | | | | | | | | | | | QWaylandSurface::inputRegionContains(const &QPointF) was added in a patch release. Expose it here and start testing it. Task-number: QTBUG-77457 Change-Id: I9e5e487e1d93a2b1873a7e219eed9ef6b0a418b5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Johan Klokkhammer Helsing2019-09-1631-131/+172
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddatadevice.cpp src/client/qwaylandinputcontext.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandwindow.cpp src/compositor/compositor_api/compositor_api.pri src/compositor/compositor_api/qwaylandquickitem.cpp Change-Id: Ice0d8c7d869c9c46113d6ee6ba3adf895a71d58f
| * Fix detection of wayland-kms supportYuya Nishihara2019-09-151-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 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * If egl_x11 is not available then don't turn on xcomposite-eglAndy Shaw2019-09-131-1/+1
| | | | | | | | | | | | | | | | Since xcomposite-egl depends on the egl_x11 feature in qtbase, then this should be explicit. Change-Id: Ic1dce9526fb50f6f56e18abd58b69bcaed6d204e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Client: Fix touch rounding errorsJohan Klokkhammer Helsing2019-09-092-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>
| * Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"Qt Forward Merge Bot2019-09-0823-101/+107
| |\
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-0823-101/+107
| | |\ | | | | | | | | | | | | Change-Id: I5d587b79b96d2b44f1975419a658c259c63fa30d
| | | * 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: Disable key repeating when rate is set to 0David Edmundson2019-09-081-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the docs of repeat_info: "A rate of zero will disable any repeating (regardless of the value of delay)." Avoiding starting the initial timer effectively disables everything Change-Id: I7489f61b2bc0e000efddb4255f1968072eeff2b8 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | | Compositor: Fix various input-related rounding errorsJohan Klokkhammer Helsing2019-09-054-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>
| * | | Client: Don't spam stderr about ignored window statesJohan Klokkhammer Helsing2019-09-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it is not supported by the protocol, neither we, nor the application developer can do anything about it. Change it from warning to debug so it only shows up when enabled. Task-number: QTBUG-76061 Change-Id: I81420e0c72a9e9652f6592d65c70c7df1e5725b9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * | | Client: Adjust for window border when setting text-input cursor rectJohan Klokkhammer Helsing2019-09-031-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set_cursor_rectangle takes wl_surface coordinates, but we sent window coordinates. Fixes: QTBUG-77987 Change-Id: Ia0bf98f9749723128bec27c3c607d1ccde2d5fd3 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | | Add missing Q_REVISION(14) for inhibitsIdleChangedJohan Klokkhammer Helsing2019-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia5aecffde9601d7249de3009910ce7fe0fed0abe Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | | Compositor: Add missing \since doc tags for inhibitsIdle propertiesJohan Klokkhammer Helsing2019-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I42056cdc57e9b7093f17825502103f1f434850d5 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | | Improve QWaylandQuickShellIntegration APIPier Luigi Fiorini2019-09-0512-333/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the API review we came up with an improved API. QWaylandQuickShellIntegration now filter events delivered to QWaylandQuickShellSurfaceItem using QObject event filter, thus we don't need a new API anymore. Change-Id: I91b05c4c8ecee56cd782f036160c569cd972abdb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | | Fix build system warningPier Luigi Fiorini2019-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Build system complains if we don't use the module name. Change-Id: Id3e2eff4851f03e0f68ea426cb3dbc2f1fc2f475 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | | Compositor: Respect wl_shm format when converting to a QImageJohan Klokkhammer Helsing2019-09-031-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Compositor] Fixed a bug where compositors would advertise support for numerous wl_shm pixel formats and then blindly assume everything to be ARGB32_Premultiplied. Note that this may cause expensive conversions if the format of the client and the screen differs. The solution is probably to add API for letting the compositor opt in to the formats it wants to support (except for argb8888 and xrgb8888 which are mandatory). Fixes: QTBUG-75635 Change-Id: I07ca3dd4ef9633222d53361860fc0ab99f02eae7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | | Merge remote-tracking branch 'origin/5.13' into 5.14Johan Klokkhammer Helsing2019-09-038-59/+79
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandinputdevice.cpp src/client/qwaylandwindow.cpp Change-Id: Ifd64debc484197829d2fe412afa98c29b382efa5
| * | | Merge remote-tracking branch 'origin/5.12' into 5.13Johan Klokkhammer Helsing2019-08-2913-65/+117
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandinputdevice.cpp src/client/qwaylandintegration.cpp src/client/qwaylandwindow_p.h src/shared/qwaylandxkb.cpp Change-Id: Ibac7998502351e93c71c9b786536298657afe3d0
| | * | 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>
* | | Client: Fix crash on wl_pointer.up after destroying a windowJohan Klokkhammer Helsing2019-09-022-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When wl_pointer version 5 was implemented, we added a raw QWaylandWindow pointer in QWaylandPointerEvent. This is a problem, because the events are stored, and the window may be deleted in the meantime. This manifested itself as flakiness in tst_xdgshell::popup() which is now fixed. Fixes: QTBUG-77976 Change-Id: If34eee0286d5a63734535d67503378516d5768c3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Fix issues raised during API reviewPier Luigi Fiorini2019-08-293-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | Some mistakes were spotted during the API comparison between version 5.13 and 5.14. Change-Id: I4135e28deb0b21c6a0cc4715e42bf00664a111d0 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Remove usages of deprecated APIs of QWheelEventSona Kurazyan2019-08-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of deprecated QWheelEvent::delta() and QWheelEvent::orientation() with QWheelEvent::angleDelta(). - Removed the tests for deprecated APIs. Task-number: QTBUG-76491 Change-Id: I2f9a53d3236bce8ba6cee66ec1b0b933d50518aa Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Client: Don't try to disconnect destroy handler from destroyed objectsJohan Klokkhammer Helsing2019-08-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Gets rid of warning about disconnecting null objects on application exit. Change-Id: Ie96d4321dfab113622d7059f6849acf15715dfa2 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | Merge dev into 5.14Kari Oikarinen2019-08-2717-23/+1023
|\ \ \ | | | | | | | | | | | | Change-Id: Iaf121f1db2fea08dd4ce16136b8d68c94b182084
| * | | Compositor: Add xdg-output unstable v1 supportPier Luigi Fiorini2019-08-2610-1/+981
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have a client-side implementation in the QPA plugin, and now we add the server-side implementation. In order to have a nice declarative API, we let users create a XdgOutputV1 instance and then associate it with the zxdg_output_v1 object when it is requested by the client. If the user forgets to create XdgOutputV1 beforehand we post an error to the client. To anticipate protocol version 3, we send zxdg_output_v1.done when we send wl_output.done. The multi-output example is extended using this protocol. [ChangeLog][Compositor] Added support for xdg-output unstable v1 Wayland extension. Change-Id: I1ec5913d8330cc01d7d634d05a289f4dc8b4fd22 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | | Remove usages of deprecated APIsSona Kurazyan2019-08-203-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make the code related to deprecated QWaylandWlScaler compile conditionally, only when QWaylandWlScaler is enabled. - Replace the usages of deprecated APIs by the corresponding alternatives. - Fix the tests to compile when the deprecated APIs are disabled. Task-number: QTBUG-76491 Task-number: QTBUG-76541 Change-Id: Ieba98858e970868a2cbc97df2d06bae346e30d7a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | | compositor: ensure keymap always contains 'us' layoutGatis Paeglis2019-08-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On X11, this is ensured by keyboard configuration tools bundled with desktop environments. More details and some history is in qtbase/1aec1a2d8df182a9e15906bcfede32a9841586ea. Short version is that 'lookup latin key' algorithm relies on a latin-key-based layout being present in the XKB keymap. Change-Id: Ie985a1e6ad0995c139a51f4dab610d791dfcaf08 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * | | Make it possible to build only the compositor moduleJohan Klokkhammer Helsing2019-08-194-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces unnecessary coupling between the compositor and client modules. [ChangeLog][Compositor] The compositor module no longer depends on the client module. Change-Id: I108e56960835b6c31c450d5ae08a0a101af9422b Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | | Client: Expose default input device through integrationPier Luigi Fiorini2019-08-233-0/+47
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose the whole default input device to clients. [ChangeLog][QPA plugin] Expose default input device to clients through the QPA API. Change-Id: I2608178f8b0ac09f766434588a280bcc2b30627d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Merge "Merge remote-tracking branch 'qt/5.13' into dev"Paul Olav Tvete2019-08-192-1/+4
|\ \ \