summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Client: Fix 100ms freeze when applications do not swap after ↵Johan Klokkhammer Helsing2019-10-221-1/+0
| | | | | | | | | | | | | | | | | 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)
* Merge remote-tracking branch 'qt/5.12' into 5.12.5Paul Olav Tvete2019-08-231-0/+4
|\ | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp Change-Id: I89fefe5bfc247eeaad3981850efa0faaab3cb145
| * Client: Emit wl_surface lifetime signals on QWaylandWindowJohan Klokkhammer Helsing2019-08-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Make handleUpdate aware of exposure changesDavid Edmundson2019-08-211-0/+4
|/ | | | | | | | | | 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 expose event compressionPaul Olav Tvete2019-08-131-0/+1
| | | | | | | | | | 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>
* Client: Fix stuttering when the GUI thread is busyJohan Klokkhammer Helsing2019-06-201-1/+1
| | | | | | | | | | | | 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: Full implementation for frame callbacks (second try)Johan Klokkhammer Helsing2019-04-241-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Client: Full implementation for frame callbacks"Johan Klokkhammer Helsing2019-01-081-8/+1
| | | | | | | | | | | | | | | | 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: Full implementation for frame callbacksJohan Klokkhammer Helsing2018-12-131-1/+8
| | | | | | | | | | | | | | | | | | | 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-0/+1
| | | | | | | | 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/+4
| | | | | | | | | | | | | | | | | 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>
* Client: Fix regression; drawing decorations of active windows as inactiveJohan Klokkhammer Helsing2018-08-281-0/+1
| | | | | | | | | | | | 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 devQt Forward Merge Bot2018-08-141-0/+3
|\ | | | | | | Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
| * Don't commit same buffer multiple timesPaul Olav Tvete2018-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add acked configure support and implement it for xdg-shell v6Johan Klokkhammer Helsing2018-05-071-28/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Client: Implement QPlatformWindow::startSystemMove()Johan Klokkhammer Helsing2018-03-051-0/+2
| | | | | | | | | 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>
* Use override when applicableJohan Klokkhammer Helsing2018-02-281-1/+1
| | | | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-override. This adds the "override" keyword where it's possible and also removes the "virtual" keyword when redundant. Change-Id: I899950e5cf8782785d30a245a9c69c1720905d50 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-21/+18
| | | | | | | | | | | | | | | | | | | | 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>
* QWaylandWindow: Fix incorrect namespace orderJohan Klokkhammer Helsing2018-01-161-2/+2
| | | | | Change-Id: I741d3fb392c6121f2d8514ee2504fc88f99092ff Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Automatically change scale when entering a new outputJohan Klokkhammer Helsing2017-11-151-0/+2
| | | | | | Change-Id: I99198d47eac5b2091fe2bfd8fc24646be9c9890a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-271-4/+11
|\ | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp src/client/qwaylandwindow_p.h src/compositor/compositor_api/qwaylandpointer.cpp Change-Id: Icbc22a1ae3cdd9cde438742817d07fccf97f647b
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-4/+11
| |\ | | | | | | | | | Change-Id: I76bfc271efcf75c75bf38f4bf58503e1d2a00839
| | * Set window screen from wl_surface.enter and leave eventsJohan Klokkhammer Helsing2017-09-111-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the pointer mScreen, which would previously cause a crash if the screen was removed. Ensures that QWindow::screen() is correct, except in the cases where: - The compositor has not yet sent enter and leave events (in which case the primary output is returned). - The compositor is not sending enter and leave events (although this is mandatory, some compositors don't do this). - The application developer has tried to move the window with QWindow::setScreen(QScreen *). Since there is no way for a client to ask to be moved to a specific monitor in windowed mode, we return the requested screen until a new enter or leave event is received. This will also be useful when implementing/fixing features where the current screen matters. Examples are QT_AUTO_SCREEN_SCALE_FACTOR and the optional output parameter to wl_shell_surface.set_fullscreen. Task-number: QTBUG-62044 Change-Id: Iafde2e278fbc8876e8dafe5b2a4d2482fdc7961a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | * Close popups in the correct orderPaul Olav Tvete2017-09-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to the protocol, child popups have to be closed before parents, but QMenuBar/QMenu will sometimes close the parent first. Change-Id: Id027ac483b727a19388df619fe1503d794e12c12 Task-number: QTBUG-62048 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| | * Fix crash when window attach is called without waiting for frame callbacksJohan Klokkhammer Helsing2017-08-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QWaylandWindow::attach was called before getting the frame callback, it would overwrite mFrameCallback. Hence, all but the last frame callback would still be alive after the QWaylandWindow destructor. When the dangling callbacks got invoked the data pointer was statically casted to the deleted QWaylandWindow, resulting in undefined behavior. In this change we only delete frame callbacks from the render thread, avoiding a race condition we fixed earlier. And we always destroy the frame callback when adding a new one, ensuring that the destructor will clean up the only remaining callback. There's a test confirming that the crash has been fixed. This fixes the flakiness of many of the qtbase auto tests. Change-Id: Iecb08ab48216eac61b1ebc5c0e0664d4aac900c0 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Temporarily rename QWaylandWindow::screen to waylandScreenJohan Klokkhammer Helsing2017-09-131-1/+1
|/ / | | | | | | | | | | | | | | | | | | The function is being made virtual in qtbase. Rename it to avoid issues with CI (missing override). It can be renamed back and made to override later. Task-number: QTBUG-63177 Change-Id: I4e3029445b34c53bfdd3e99254a690a1fac6f06e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Send SurfaceCreated and SurfaceAboutToBeDestroyed events for wl_surfaceJohan Klokkhammer Helsing2017-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the events were matching the life cycle of QWaylandWindow. This commit changes it so the events are matching the life cycle of wl_surfaces instead (a QWaylandWindow can outlive several wl_surfaces). Some of these events were already sent in QWindowPrivate (the first and last). Now we handle the cases where the wl_surface is destroyed and recreated due to hiding/showing the window or when changing the role of the wl_surface. Task-number: QTBUG-58423 Change-Id: Ie4a4e7dd529e1a41a2cf42e02cebb3c8aca4a4cc Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Marco Martin <notmart@gmail.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-0/+1
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/client/qwaylandwindow.cpp Change-Id: I3ae070ff20df4b858a4eef769438092c061e47ef
| * Match WaylandWindow scale to what we set on the buffer, not the screenDavid Edmundson2017-05-181-0/+1
| | | | | | | | | | | | | | | | | | Currently if the screen scale changes we report a new devicePixelRatio to rendering but we don't send a new set_buffer_scale nor do we update the buffer sizes. This leaves us in a corrupt state. Change-Id: I5bb2bd5eec440cd1ce9080cd3a3dc65448f68298 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-211-0/+1
|\| | | | | | | Change-Id: I7285dfeaac0d7963607930904aa017bedb1e48ab
| * Merge remote-tracking branch 'qt/5.8' into 5.9Paul Olav Tvete2017-03-011-0/+1
| |\ | | | | | | | | | Change-Id: I43cd0147a63b5523e3112f09bbfe60e1d6636e6c
| | * Initialize the first wl_surface in the constructor of QWaylandWindowJohan Klokkhammer Helsing2017-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to get a pointer to a wl_surface immediately after platform window creation. Task-number: QTBUG-58423 Change-Id: I2e62380af8b34d05ae31baacc071766493633022 Reviewed-by: Marco Martin <notmart@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | | Adapt to the API change in QPlatformWindow::setWindowStateOlivier Goffart2017-03-281-5/+5
| | | | | | | | | | | | | | | Change-Id: Ic6655f239ea449baf862934608feda182799c42d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Prepare for qtbase changePaul Olav Tvete2017-03-201-1/+1
|/ / | | | | | | | | | | | | | | | | | | The signature of setWindowState is changing. Remove the 'override' so qtwayland compiles without error against both the new and the old version. Task-number: QTBUG-59588 Change-Id: I2adc6a5a1addc9b8855a3a1b3c1f0e3952181846 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-251-20/+22
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/custom-extension/client-common/main.cpp src/client/qwaylandwlshellintegration_p.h src/client/qwaylandxdgshellintegration_p.h src/compositor/compositor_api/qwaylandquickoutput.h src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h Change-Id: Ic78c610ddf102b0a185294f625bbfcb9238b0f3c
| * Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-231-20/+20
| | | | | | | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Fix build without feature.cursorTasuku Suzuki2017-01-131-0/+2
| | | | | | | | | | Change-Id: If244e7ac58133ae6fbefacfa243d47fa210140be Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add xdg_shell_v6 support for Qt clientsGiulio Camuffo2016-12-021-0/+1
|/ | | | | | | Task-number: QTBUG-56174 Change-Id: I6610905d0c9f29be29e812bcac193ea2a7e4f107 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use the feature system internallyLars Knoll2016-11-231-1/+1
| | | | | | | | | Get rid of almost all DEFINES += ... in the pro files, instead use the proper QT_CONFIG() macro to determine whether a feature is available. Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't reset the cursor at every mouse moveGiulio Camuffo2016-11-221-1/+0
| | | | | Change-Id: I67f9a0d171da403ebb124ab584c2510891da80fc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Create and destroy the shell surface when showing and hidingGiulio Camuffo2016-11-171-0/+2
| | | | | | | | | | | | | | | | | | This changes the shell surface handling for windows, and instead of creating the shell surface at initialization time, and then attaching a null buffer to hide it, it creates the shell surface on setVisible(true), and destroys it on setVisible(false). This fixes hiding when using xdg_shell, as that interface defines that attaching a null buffer to an xdg_surface is an error. Also this should help with bugged EGL drivers which attach a buffer after eglSwapBuffers() returns, which used to cause a newly hidden window to get a new valid buffer after we attached a null one, showing it again. Task-number: QTBUG-47902 Change-Id: I8e0a0442319a98cc1361803ea7be1d079b36fc8c Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove QWaylandWindow::shellManagesActiveStateJohan Klokkhammer Helsing2016-11-101-2/+0
| | | | | | | | | | | | If m_shellSurface was deleted, there was no way for QWaylandDisplay to know whether the shell handled window deactivation or not. The shell integration now always handles the window active state. The default implementation of QWaylandShellIntegration will make a window active on keyboard focus. Change-Id: I80cfce9976b1d3c57094fdd8980c9110b873f239 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix race condition on mFrameCallbackPaul Olav Tvete2016-10-061-1/+2
| | | | | | | | Don't try to destroy the callback from two different threads. This caused a crash with brcm-egl. Change-Id: Idcb18fca9ed7f84902b88212c0cebd67932a59d3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix FramelessWindowHintPaul Olav Tvete2016-09-181-0/+1
| | | | | | | | | setFlags() works just like setWindowState(): we have to use the supplied parameter because the window's state hasn't been updated yet. Change-Id: I223e01ef192f30911697e449669e745f0ad59d99 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* Merge remote-tracking branch 'qt/5.6' into 5.7Paul Olav Tvete2016-08-261-0/+2
|\ | | | | | | Change-Id: I6784a53fcc2f0f68b8e916181cb8cdef263782b8
| * Client: Fix keyboard focus logic and crashJohan Klokkhammer Helsing2016-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | The previous solution did not check for nullptr before dereferencing, which caused a crash. Furthermore, it checked the new ShellSurface's shellManagesActiveState before deciding whether to unfocus the old one. Task-number: QTBUG-55526 Change-Id: I410b6200a5b7b86806f70970730045a4a25f21db Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-301-11/+11
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandinputcontext_p.h src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h Change-Id: Iac517e1985e4e67d7ca00ca4c10dcda9dd9079f9
| * Add missing Q_DECL_OVERRIDEs to client classes.Johan Klokkhammer Helsing2016-06-271-11/+11
| | | | | | | | | | | | Change-Id: I10e550a25ce498bbeedc242ac73059cc6fdcef30 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Make qwaylandclientexport publicPaul Olav Tvete2016-05-191-1/+1
| | | | | | | | | | | | | | ...since it's being used by a public header. Change-Id: I38049c27c8bd4dc793416bf836d79c4226172d38 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* | Move drag icon relative the cursor hotspot positionErik Larsson2016-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | Instead of placing the drag icons top-left corner at the cursors hotspot the drag icon is moved so it will be placed correct relative the cursor hotspot. This will makes the drag feeling more realistic. Change-Id: I8d60ae1b7788accb9034575983417abae4c58c1a Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io>