summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* 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 xdg-shell: Fix crash when switching popupsJohan Klokkhammer Helsing2019-02-122-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* wl_eglstream_controller implementation for NVIDIAPaul Olav Tvete2019-01-084-0/+82
| | | | | | | | | | | | | | This adds a new client buffer integration: wayland-eglstream-controller, which contains the EGLStream logic from wayland-egl, and additionally uses NVIDIA's wayland-eglstream-controller protocol to avoid the issue where the stream is not ready at the time of first buffer attach. This is not enabled by default. Can be used like this: QT_WAYLAND_CLIENT_BUFFER_INTEGRATION=wayland-eglstream-controller ./pure-qml Fixes: QTBUG-71697 Change-Id: I73bb2a8fe9852afe1b5807cbb8c35dc4c7624dad Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use new feature name xkbcommon_evdev -> xkbcommonGatis Paeglis2018-12-055-10/+10
| | | | | | | | | The xkbcommon configure logic was refactored in qtbase/c3a963da1f9e7b1d37e63eedded61da4fbdaaf9a. For more details see the relevant commit. Change-Id: Ic1aa26846ab8266c589f6e92dc8b81aba36df58a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-12-054-8/+10
|\ | | | | | | Change-Id: Ica38060e6d624a7534660eabec604f6795970c95
| * Only print deprecation warning when using deprecated shellsPaul Olav Tvete2018-11-072-8/+8
| | | | | | | | | | | | | | | | | | Avoids printing deprecation warnings for shells that are available by default but not actually used. In particular, avoids warning about wl-shell when using ivi-shell. Change-Id: Id075e97572e6ec876ad24f369808c61a479e9b07 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * Client: Explicitly send expose window on first configureDavid Edmundson2018-10-312-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Before 88a0246a46c30e08e9730d16cf8739773447d058 we would always call QWaylandWindow::applyConfigure which in turn sends an expose event. Without that clients do not commit their initial buffer. This adds back the expose event on the first received configure. Fixes: QTBUG-71509 Change-Id: Ica39bb23245957948e1e1f75caf4f16f7b086ef7 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client: Rename m_topmostPopup to clarify its goalDavid Edmundson2018-11-144-10/+10
| | | | | | | | | | | | | | | | | | | | This is used when creating new grabbed popups to ensure they are only created on the topmost grabbing popup as per the specification. Non-grabbing popups don't have this restriction. Change-Id: I8e2b8cd0f091688c847f81f2e5d33ce2f0df96a1 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client: Don't require an input device for non-grabbing popupsDavid Edmundson2018-11-144-26/+40
|/ | | | | | | | | | It's valid to create a non-grabbing XDG-popup, such as a tooltip, before an input event. The current guard should only apply for grabbing popups, otherwise tooltips created early are turned into XDG-toplevels resulting in incorrect positioning. Change-Id: I5bb59a68964ef2375c81e8b4e1a73361b9d2cbcc Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge 5.12 into 5.12.0Oswald Buddenhagen2018-10-304-8/+34
|\ | | | | | | Change-Id: Ic7b7999f42b1867982b9410efb5224d68e9443f8
| * Client: Don't attach buffers to unexposed windowsJohan Klokkhammer Helsing2018-10-264-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 fullscreen regression on wl-shellJohan Klokkhammer Helsing2018-10-281-1/+1
|/ | | | | | | | | | | The code for isNormal was wrong, so set_toplevel (which clears fullscreen state) would be sent unless the window was both maximized and fullscreen. Fixed it and made it a little bit more readable. Change-Id: Icaa52d3a058df064a0bd1164119af3f511cb4220 Fixes: QTBUG-71350 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client (xdg-shell): Only restore normal size when not maximizedJohan Klokkhammer Helsing2018-10-092-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | kwin and perhaps other compositors sometimes send questionable configure events with state set to maximized and size == {0,0}. Previously, we would then restore the m_normalSize, which would give us a maximized window with the size of a windowed (normal) one. A size of zero usually means that it's up to the client to decide, which makes sense for non-maximized windows, but not so much for maximized ones. This is what the protocol spec says about the maximized state: The surface is maximized. The window geometry specified in the configure event must be obeyed by the client. It's fixed in the dev version of kwin, but until then, let's be on the safe side and only resize the window if things make sense. [ChangeLog][QPA plugin] Fixed a bug where maximized windows would resize to their unmaximized size if the compositor sent an invalid configure event. Change-Id: I2371b29c82426ac48cd1c18c14c3dd0fe4f2250e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add server buffer integration using Linux dma-bufPaul Olav Tvete2018-09-219-3/+164
| | | | | | Fixes: QTBUG-70494 Change-Id: Iaa4990fe9d39a1f9fb81f5e5f19039aa2e52dcac Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Don't try to use wl_proxy_get_version with libwayland < 1.10Johan Klokkhammer Helsing2018-09-131-0/+7
| | | | | | | | The pregenerated header for xdg-shell was generated using wayland-scanner 1.13 which uses wl_proxy_get_version which was introduced in 1.10. Change-Id: I19507ff6e543d4b0aa53e0d022d680090c34ab50 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Create feature wayland-shm-emulation-server-bufferJohan Klokkhammer Helsing2018-09-102-6/+6
| | | | | | | | | And make OpenGL a requirement, in order to make builds without OpenGL work again. Fixes: QTBUG-69779 Change-Id: Iff1153b0aaca8e115f47c59c2ceb028e638e3fe9 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Prefix and suffix server buffer integrationsJohan Klokkhammer Helsing2018-09-102-4/+4
| | | | | | | | | [ChangeLog][Compositor] Features for server buffer integrations have been renamed. "drm-egl-server" is now "wayland-drm-egl-server-buffer" and "libhybris-egl-server" is "wayland-libhybris-egl-server-buffer". Change-Id: I06a9d1b1c9219c88045fe966be134ff072cd756e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Remove unused constructor for xdg-shell v5Johan Klokkhammer Helsing2018-09-062-6/+0
| | | | | Change-Id: Idcb2220237b3dba0a296fbb9a86497a3d0022d5f Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Use customized version of generated files for xdg-shell-v5Johan Klokkhammer Helsing2018-09-0512-22/+1867
| | | | | | | | | | | | | Check in qtwaylandscanner and wayland-scanner generated files with renamed symbols to avoid conflicts with xdg-shell stable. When this was done on the compositor side, we thought we didn't have to do it for the client side because the conflicting symbols are used in separate plugins. Turns out this breaks static builds, though. Task-number: QTBUG-69896 Change-Id: I461df8e136b741063eafe13e858734a3aafdf020 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Deprecate xdg-shell-v5 and wl-shellJohan Klokkhammer Helsing2018-09-052-0/+8
| | | | | | | | | | [ChangeLog][QPA plugin] Deprecated the shell integrations for xdg-shell-unstable-v5 and wl-shell. The stable version of xdg-shell should be used instead. Task-number: QTBUG-68838 Change-Id: Iab89059ec13efc2f72c3317a26439d7683e03e79 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Client: Fix regression; drawing decorations of active windows as inactiveJohan Klokkhammer Helsing2018-08-281-2/+3
| | | | | | | | | | | | 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>
* xdg-shell stable: Make sure popup parent is topmost popup when grabbingJohan Klokkhammer Helsing2018-08-172-3/+32
| | | | | | | | | Avoids protocol errors on Weston, gnome-shell and wlroots-based compositors. This is the same fix as 75c996e7, but for the stable version of xdg shell. Change-Id: Ic998fb920a8b1b131e42833a61e663704c8663e4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Client: Implement xdg-decoration-unstable-v1 for SSD supportJohan Klokkhammer Helsing2018-08-146-8/+273
| | | | | | | | | | | | | | [ChangeLog][QPA plugin] Added client-side support for the xdg-decoration-unstable-v1 Wayland extension. Qt clients will now let the compositor draw the window decorations if configured through this extension. Note: The env var QT_WAYLAND_DISABLE_WINDOWDECORATION is still supported, but works on a higher level, and for all shell integrations, while xdg-decoration only works with xdg-shell stable. Task-number: QTBUG-69746 Change-Id: I9dd0331bbd8d624c6be54ed23ee3b96446d5820d Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-141-2/+4
|\ | | | | | | Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
* | Client: Log configure states to logging categoryJohan Klokkhammer Helsing2018-08-092-0/+4
| | | | | | | | | | | | | | | | | | States are not visible in WAYLAND_DEBUG output since array values are not printed there. Logging the states to the Wayland QPA logging category gives us a convenient way of seeing what states are configured. Change-Id: If71c6df3180eba3f8efb08135a67b417940c3ffe Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Fix memory leak for xdg_popup and xdg_toplevelJohan Klokkhammer Helsing2018-08-081-4/+8
| | | | | | | | | | Change-Id: I561e2af0cdc812ea4f499525b4af0a4ab7ad8182 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-101-0/+2
|\| | | | | | | Change-Id: I4c25009c207ab36219976e75343a9b6398d3a42d
| * Fix static builds with libwayland-eglSamuli Piippo2018-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a naming conflict between the client buffer integration, wayland-egl, and the system library libwayland-egl.so Rename the plugin binary to qt-plugin-wayland-egl to avoid the issue. This commit appends commit 83db09bd0acaafb256880e3a217ed9df0641a00a which did the same for the client plugin Task-number: QTBUG-65652 Change-Id: I245192a9f844945200209cc2e3a9f419c541d33b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Draw disabled text color for inactive window decorationsJohan Klokkhammer Helsing2018-06-291-2/+4
| | | | | | | | | | | | | | Task-number: QTBUG-68834 Change-Id: Iced478d12b56fc360c0d824cf5876855d887f9a2 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-283-5/+37
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandxdgsurface.cpp src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5.cpp src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h Done-with: Johan Klokkhammer Helsing <johan.helsing@qt.io> Change-Id: Ia39be6254a95af1c4efa831358cc06a697da3423
* | Client: Improve the look of bradientJohan Klokkhammer Helsing2018-06-251-108/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] The window decorations have had a redesign, they now use the window background color instead of the blue gradient. Changes: - Removed the gradient - Used QPalette::Window for color instead of QPalette::Highlight - Removed the xpm buttons as they look bad on high-dpi - Redid the non-xpm buttons, removing their border - Used anti-aliasing for cross icon (diagonal lines) - Size of buttons have been increased, to be easier to click - The position of the buttons have been shifted slightly - Reduced rounding of the corners slightly - Switched to non-bold and increased the font size for the window title Task-number: QTBUG-68834 Change-Id: I17b2464c5e2518294d795512493bfe93e9a2f550 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Fix build: some shells need to link to libxkbcommonThiago Macieira2018-06-203-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | They use QtWaylandClient's private headers. In file included from qwaylandinputdevice_p.h:1, from qwaylandxdgshellv6.cpp:45: qwaylandinputdevice_p.h:69:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory Change-Id: I6efb28c3145047559ec0fffd1538a642167da67f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Fix warning about extra constThiago Macieira2018-06-203-3/+3
| | | | | | | | | | | | | | qwaylandxdgsurfacev5.cpp:77:97: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers] Change-Id: I6efb28c3145047559ec0fffd1538a5ce04f2721b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client: Move bradient buttons inside processMouseTopJohan Klokkhammer Helsing2018-06-201-12/+15
| | | | | | | | | | | | | | To avoid them covering for the edges of the window Change-Id: Id8a1362ec11bd25f54cb2c9fbcbd562af8f283d8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Get rid of QWaylandShellSurface::setTypeJohan Klokkhammer Helsing2018-06-1912-67/+39
| | | | | | | | | | | | | | | | | | | | 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: Use a pixel font size for window decorationsJohan Klokkhammer Helsing2018-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | The window title bar's height is given in device pixels, so the font size should be as well. Task-number: QTBUG-68834 Change-Id: I5a82deb39439088dd55152fb8bae5c2d19d8b33e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | Client: Fix bradient compilation error without xpmJohan Klokkhammer Helsing2018-06-191-1/+1
| | | | | | | | | | Change-Id: I8cbe939352713f643474d383da95b6d13be798a8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Remove applyConfigure for xdg-shell popupsJohan Klokkhammer Helsing2018-06-134-14/+0
| | | | | | | | | | | | | | | | It's just dead code, we can add it back in the unlikely event that we should need it. Change-Id: I209fe92fb160e022c992384d731964e774596f74 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Set window geometry for xdg-shell v6 and stableJohan Klokkhammer Helsing2018-06-072-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eventhough, according to the protocol spec, it should work perfectly fine without setting the geometry, gnome-shell 3.28.2 chokes on it and applications get stuck in the upper right corner and can't be moved. Qt seems to be the only toolkit left that doesn't set the window geometry, so let's just do it the simple, though somewhat incorrect, way. The downside of this patch, is that the unset window geometry used to include subsurfaces that extended outside the parent surface, but here we just set it to the frameGeometry of the window. Task-number: QTBUG-68575 Change-Id: I8a9d029ff6d57bd33294658e3bfd69ff08cd38c1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: use new shell plugin pattern for ivi-shellPaul Olav Tvete2018-05-292-29/+15
| | | | | | | | | | | | | | | | | | | | Initialize should return false if the ivi-application global is not present. The previous code worked because ivi-shell was last in the priority list. This may not always be the case if we add more shells, or allow QT_WAYLAND_SHELL_INTEGRATION to be a list. Change-Id: Iec4409db039b3ebe163264187f901af5d845e54d Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Client: Add shell integration for xdg-shell stableJohan Klokkhammer Helsing2018-05-298-0/+758
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] Added support for xdg-shell stable. Mostly a copy of xdg_shell unstable v6 with prefixes and suffixes removed. Otherwise, this is what changed: - The global is now named "xdg_wm_base", since "xdg_shell" was taken by xdg-shell <= v5. - Anchors and gravities are not bitfields anymore. Task-number: QTBUG-66783 Change-Id: I8ca881aae52cc07b22ff5e26df13a9a1566f58f4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Client: Set unconfigured xdg surfaces (v6) as not exposedJohan Klokkhammer Helsing2018-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, isExposed would always return true, which resulted in a wl_egl_window being created and an illegal attach and commit occurring. i.e. protocol errors such as: zxdg_surface_v6@15: error 3: xdg_surface has never been configured Change-Id: I277c65d663cfed0fe436a128fe1963d138f01c87 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | Client: Move xdg-shell-v6 to a pluginJohan Klokkhammer Helsing2018-05-288-0/+757
| | | | | | | | | | | | | | | | [ChangeLog][QPA plugin] The xdg-shell-v6 shell integration has been moved to a plugin. Change-Id: I548d19590ddbc8ad3e791301359a6de17ac9dcd8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Move wl-shell to a pluginJohan Klokkhammer Helsing2018-05-188-1/+679
| | | | | | | | | | | | | | | | | | | | | | [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>
* | xdg-shell-v5 client: Remove accidental qDebugJohan Klokkhammer Helsing2018-05-142-2/+1
| | | | | | | | | | | | Change-Id: I1dbe14b317dd0a460abf3602da1772968d2fe150 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | xdg-shell-v5: Suffix classes with v5Johan Klokkhammer Helsing2018-05-1410-92/+92
| | | | | | | | | | | | | | To make it easier to distinguish when implementing xdg-shell stable. Change-Id: I730f3b8411f68b7e5c707b7ba6b94b2563ac500e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Rename xdg-shell.xml to xdg-shell-unstable-v5.xmlJohan Klokkhammer Helsing2018-05-144-4/+4
| | | | | | | | | | | | | | | | | | Also change the protocol name in the xml file from xdg_shell to xdg_shell_unstable_v5 (similar pattern as v6) because qtwaylandscanner doesn't support the file name being different from the protocol name. Change-Id: I1d9edf7c8ca512e716284250a2b2bc13e205c33c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Move xdg-shell-v5 to a pluginJohan Klokkhammer Helsing2018-05-0912-1/+1020
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-073-5/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 override when applicableJohan Klokkhammer Helsing2018-02-284-6/+6
| | | | | | | | | | 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>