summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Client: Fix crash when showing a child window with a hidden parentJohan Klokkhammer Helsing2019-11-051-3/+4
| | | | | | | | | | | | | [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)
* Client: Fix 100ms freeze when applications do not swap after ↵Johan Klokkhammer Helsing2019-10-221-37/+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>
* Merge remote-tracking branch 'origin/5.12.5' into 5.12Qt Forward Merge Bot2019-09-071-1/+8
|\ | | | | | | Change-Id: Ic73262146f51a9e7f4ffab46511654ad70c4f514
| * Merge remote-tracking branch 'qt/5.12' into 5.12.5Paul Olav Tvete2019-08-231-2/+6
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I89fefe5bfc247eeaad3981850efa0faaab3cb145
| * | Client: Make handleUpdate aware of exposure changesDavid Edmundson2019-08-211-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | 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: Emit wl_surface lifetime signals on QWaylandWindowJohan Klokkhammer Helsing2019-08-191-1/+5
|/ | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix expose event compressionPaul Olav Tvete2019-08-131-1/+3
| | | | | | | | | | 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-201-28/+31
| | | | | | | | | | | | 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>
* 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>
* Client: Full implementation for frame callbacks (second try)Johan Klokkhammer Helsing2019-04-241-28/+152
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Client: Don't be exposed if we want to create a sub or shell surfaceJohan Klokkhammer Helsing2019-04-081-3/+15
| | | | | | | | | 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>
* Client xdg-shell: Fix crash when switching popupsJohan Klokkhammer Helsing2019-02-121-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Client: Full implementation for frame callbacks"Johan Klokkhammer Helsing2019-01-081-88/+19
| | | | | | | | | | | | | | | | 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>
* Client xdg-shell: Fix protocol error for tooltips on popupsJohan Klokkhammer Helsing2018-12-261-1/+1
| | | | | | | | | | [ChangeLog][QPA plugin] Fixed a protocol error that used to happen when closing a menu with an active tooltip. Fixes: QTBUG-71734 Change-Id: I784fef08494fabaa4debea11f51116cf9de1f86e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Full implementation for frame callbacksJohan Klokkhammer Helsing2018-12-131-19/+88
| | | | | | | | | | | | | | | | | | | The Wayland plugin now takes full control over delivering update request and implement frame callbacks for both egl and shm. Fixes two bugs: [ChangeLog][Client] The non-blocking version of eglSwapBuffers is now used. This fixed a bug where minimized windows would block the event loop. 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. Fixes: QTBUG-69077 Change-Id: I2d3a6896c32e63d8520b57448a3601a817816a91 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Don't spam expose eventsJohan Klokkhammer Helsing2018-10-261-1/+4
| | | | | | | | Only send expose event when the geometry actually changed. Change-Id: Ic06986ce5d11e0ff7a842303f57093b8ff25b9f6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Don't attach buffers to unexposed windowsJohan Klokkhammer Helsing2018-10-261-0/+22
| | | | | | | | | | | | | | | | | QBackingStore::flush is sometimes called with an unxeposed window, in that case, don't attach the buffer to the wl_surface immediately, as that causes protocol errors with xdg_shell. Flushed buffers are instead stored until we get the first configure event. [ChangeLog][QPA plugin][xdg-shell] Fixed a bug where buffers were sometimes attached and committed before the first configure event, causing protocol errors. Fixes: QTBUG-71345 Change-Id: If9409d97bd25f6b13940c56141920a664c349c8e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Avoid spurious move events after configure callDavid Edmundson2018-10-031-1/+1
| | | | | | | | | | | | | | | | | Whilst wayland can't actually move the window in a QWindow::setGeometry call the previous behavior was to keep it so that it appeared to the client that it had moved. The new behavior is non-consistent, QWindow::setPosition will update QWindow::position until the first configure call is received at which point it will move back to 0,0. This then generates a QMoveEvent for the window that hasn't moved. This patch keeps the QWindow::position consistent with the user request and doesn't generate move events. Change-Id: Ifb1433b3902d44c1b2e43036bc1805a6e00128fb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Don't include wayland-client-core.hJohan Klokkhammer Helsing2018-09-141-1/+1
| | | | | | | | It requires libwayland 1.8 and we're supposed to support versions as old as 1.6 Task-number: QTBUG-70528 Change-Id: Iff4c2542d103d53aba8db99ecceddfccb79cfcb6 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Fix regression; drawing decorations of active windows as inactiveJohan Klokkhammer Helsing2018-08-281-0/+5
| | | | | | | | | | | | We can't trust QWindow::isActive, because it relies on focusWindow, which may be updated too late, and there might also be multiple active toplevel windows at once on Wayland. Even though Qt doesn't support multiple seats, we should still draw the decorations of active windows correctly. This implements QPlatformWindow::isActive and uses it in the decorations. Change-Id: I34d79b354e2d26694533e2319a26f24085212243 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-08-251-0/+1
|\ | | | | | | Change-Id: Ib6d23655a5c9ee059a9560e862d38746f508caee
| * Client: Clear entered screens when resetting windowJohan Klokkhammer Helsing2018-08-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, windows that were hidden and shown again would have the old list of entered screens. Aside from occasionally getting the current screen wrong, this also polluted the log with bogus warnings about unexpected enter events. This problem could be seen quite easily by opening, closing and opening a menu. [ChangeLog][QPA plugin] Fixed a bug where a window that was hidden and then shown on different screen would still think it was on the first screen. Change-Id: I1b27433ea6607a218384d814ae4c16b9c4395948 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-141-0/+9
|\| | | | | | | Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
| * Don't commit same buffer multiple timesPaul Olav Tvete2018-08-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt we call flush() when we think the window might need to be updated. It is also possible to trigger a flush while painting. Two fixes: 1) If there are attempted flushes between beginPaint() and endPaint, queue them up, and do them in endPaint(). 2) Make sure we only commit the buffer once: after that the compositor owns the buffer, and it can repaint on its own. Change-Id: Ibf61068fa95760eb67dbc0b1d0534854114ea528 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client decorations: Don't spam mouse leave eventsJohan Klokkhammer Helsing2018-08-131-1/+3
| | | | | | | | | | | | | | | | Previously, we would send one leave event each time the mouse was moved on the decorations. Change-Id: I57bd6e57261447db8a8c5ab45dc8f3fdfed33a49 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Get rid of QWaylandShellSurface::setTypeJohan Klokkhammer Helsing2018-06-191-2/+0
| | | | | | | | | | | | | | | | | | | | This shouldn't change any behavior, but lets the shell integrations choose if they want to use the extremely hacky QWaylandWindow::transientParent(). Hint: Not all shells need the hacks, and not all shells need them in all cases, and some shells may need even more hacks. Change-Id: Id105e4feb83cc9c14dcf07dcca55fcd5e63d4a2b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Don't restore content cursor when on the window decorationsJohan Klokkhammer Helsing2018-06-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When the cursor entered the window decorations, QWaylandWindow::restoreMouseCursor would be called from the pointer enter handler messing up the cursor from the decorations, making the resize border seemingly hard to hit. Don't restore the cursor unless inside the window contents. [ChangeLog][QPA plugin] Fixed a bug where the arrow cursor would be shown instead of the resize cursor when hovering over the window decoration border. Change-Id: I2fabd8d626deaa7006734a4d5c6d10d6c0114466 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-131-1/+12
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I6596d1a127cc93e53ec30cd881da1810cb8076d5
| * Don't ask libwayland to set absurdly long window titlesJohan Klokkhammer Helsing2018-06-061-1/+12
| | | | | | | | | | | | | | | | It will cause libwayland to terminate the application. Task-number: QTBUG-68715 Change-Id: I1d1830453da224bec8bf4c5d6ab087c0e05328a8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Move wl-shell to a pluginJohan Klokkhammer Helsing2018-05-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] The wl-shell shell integration has been moved to a plugin. This also adds API so shell integrations can return native resources for windows, as it was needed in order to continue to supporting wl_shell_surface. Change-Id: Ibc68ffcc5b0c6993d8f4e078f663e4d67340e1a5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Move xdg-shell-v5 to a pluginJohan Klokkhammer Helsing2018-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step in deprecating xdg-shell unstable v5 and making the good names available for the good names for xdg-shell stable. Shell initialization has been refactored slightly, so the QWaylandShellIntegrationFactory actually tries to initialize the shell integration before returning it. Similarly for the factory method of non-plugin shells. Change-Id: I85e60594c4fc03c6f302c04316110aed428d28dc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Add acked configure support and implement it for xdg-shell v6Johan Klokkhammer Helsing2018-05-071-85/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem: The code in QWaylandWindow::setWindowStateInternal made many assumptions about how the shell surface responded to new window states, and when and if they were applied. Particularly: - The shell integrations support different subsets of Qt::WindowStates, so it doesn't make sense to map from states to setFullscreen, setNormal, etc. in QWaylandWindow because it really depends on the shell integration how it should be handled. - Some states are not supported/unknown on some shells and should immediately be rejected. - On some shells, particularly those where the current state is unknown, flags need to be resent even though they didn't change. - Should handleWindowStatesChanged be called immediately (client decides) or should it wait for a configure event (compositor decides)? I.e. the mState variable only makes sense for some shells. Furthermore, when state changes come from the compositors, some shell integrations require that a configure event is acked by the client and that the next committed buffer's size and content matches that configure event. Previously, we would just ack immediately and still send a buffer with the old size before a correct frame was drawn. i.e. sending incorrect acks, which would lead to protocol errors on some compositors. Additionally, QWaylandWindow::createDecoration() also assumed that windows should have decorations unless they are fullscreen. This is not always the case, particularly on ivi-application and probably on future shell integrations for embedded or tiling window managers etc. The Solution: The responsibility of mapping requested window states to Wayland requests have been moved to the QWaylandShellSurface implementation. QWaylandWindow now calls a new virtual, QWaylandShellSurface::requestWindowStates(Qt::WindowStates), instead of trying to be smart about it. The virtual getters and setters for window states have now been removed from the QWaylandShellSurface interface. It's now also the shell surface implementation's responsibility to call QWaylandWindow::handleWindowStatesChanged if and when it knows a new state is effective. QWaylandWindow::configure has been replaced with QWaylandWindow::applyConfigureWhenPossible(), which causes another new virtual, QWaylandShellSurface::applyConfigure(), to be called whenever we're free to resize and change the states of the next buffer (this is when states should be acked). This means that shells that use acked states need to store the pending states themselves, call applyConfigureWhenPossible(), wait for applyConfigure() to be called, call resizeFromApplyConfigure() and handleWindowStatesChanged(), and finally ack the applied state. Acked state for xdg-shell v5 and v6 has now been implemented, which also means we've now: [ChangeLog][QPA plugin] Implemented support for maximizing, minimizing, and setting fullscreen with xdg-shell unstable v6. [ChangeLog][QPA plugin] QWindow::isActive now follows configure events on xdg-shell unstable v6 (like v5). QWaylandWindow::createDecoration queries QWaylandShellSurface::wantsDecoration before creating window decorations, instead of using the previously unreliable QWaylandWindow::isFullscreen(). [ChangeLog][QPA plugin] Window decorations are now automatically disabled for ivi-application. The refactor also removes a couple of hacks: - QWindowSystemInterface::flushWindowSystemEvents() was called in QWaylandWindow::setWindowStates. Since this hack was introduced, the events now have oldState and newState members, and their values seem to make sense (ensured in the tests). - The hack for unminimizing on xdg-shell v5 in QWaylandWindow::createDecoration was not needed anymore. Finally, tests have been added for xdg-shell v6 to ensure that the right Wayland requests are sent, that we respond to configure events from the compositor, and that the Qt events and signals emitted on the client side make sense. Task-number: QTBUG-53702 Task-number: QTBUG-63417 Task-number: QTBUG-63748 Task-number: QTBUG-66928 Change-Id: Ib4c36b69105750f9dbdcc78adcf71e2e994cc70d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Use deliverUpdateRequest on QPlatformWindow instead of QWindowPrivateJohan Klokkhammer Helsing2018-04-061-2/+1
|/ | | | | | | | | This is because bff59f87ba11cac1dfa710f021522372de7a776f in qtbase. Task-number: QTBUG-67480 Change-Id: I2bb89f94ecc1d78e8919cd16e7bf9d8877baf121 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* QWindow::requestActivate() is not supported on WaylandJohan Klokkhammer Helsing2018-03-081-2/+1
| | | | | | | | | | Return false for the WindowActivation capability to ensure we don't run tests that require it. Change-Id: Ia24d6eef02d462a25f3d50597debda9e062b3955 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Test for null pointer before using itAntonio Larrosa2018-03-051-1/+1
| | | | | | | | Task-number: QTBUG-66867 Change-Id: Ibbe407fa3ac32141b52fa0086e9f1ebfd27052ba Done-with: Fabian Vogt <fvogt@suse.de> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Jan Grulich <jgrulich@redhat.com>
* Client: Implement QPlatformWindow::startSystemMove()Johan Klokkhammer Helsing2018-03-051-0/+8
| | | | | | | | | Hooks into what we already use for the window decorations. Task-number: QTBUG-58044 Change-Id: Idcd971f69d52a5bb760bb6bffb26e9f5bdd429df Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-17/+1
| | | | | | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file \ -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \ -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \ -header-filter='qtwayland' \ -fix Afterwards I ran search and replace on the diff to clean up some whitespace errors: - Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: ' - Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, ' - Replaced '\n\+\s*\n' with '\n' I also had to do some manual edits, because for some reason, this particular clang-tidy check doesn't trigger for some files. Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use nullptr instead of 0 or NULLJohan Klokkhammer Helsing2018-02-201-11/+11
| | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2018-01-311-1/+1
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-181-1/+1
| |\ | | | | | | | | | Change-Id: I6c201769561f53d88c89f75cce7d9a7b2643d2f6
| | * Fix requestUpdate()Paul Olav Tvete2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit 3e745ea053e42ba087438203df3bd76b30a08eb2, mFrameCallback is set to null when the next buffer is attached, not when the callback arrives. This means that a requestUpdate() after the frame callback would never be delivered. The solution is to test mWaitingForFrameSync instead. There is still a small race condition, but the failure case is that the update will arrive after 5 ms instead of exactly at frame sync. Change-Id: I413ed2b76c8527f825e501077bab712146b6705f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Port away from QRegion::rects()Marc Mutz2017-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | Use begin()/end() instead. Change-Id: I1a73b4518ee7408271ec913a219c034e330b0d5a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Automatically change scale when entering a new outputJohan Klokkhammer Helsing2017-11-151-4/+23
| | | | | | | | | | | | | | | | | | Change-Id: I99198d47eac5b2091fe2bfd8fc24646be9c9890a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-11/+18
|\| | | | | | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * | Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3Paul Olav Tvete2017-10-251-11/+18
| |\| | | | | | | | | | Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
| | * Ensure QWaylandWindow::transientParent has a shell surfaceJohan Klokkhammer Helsing2017-10-251-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may not be a perfect solution, but it's better than the current one, where the transient parent may not have a shell surface (because the window may be hidden or not yet initialized). Task-number: QTBUG-63840 Change-Id: Ia5f04376d4b6d12b41ceeab5ba13cdc1b63b4e3c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>