From e6d55239c454d454978edb7d8b17f6c993e7ba07 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 30 Oct 2018 19:02:26 +0000 Subject: [PATCH 1/4] Client: Explicitly send expose window on first configure Before 46aece51330b6f9b5b4bfd68a5b3b183dc5b1c38 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 --- .../plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp | 1 + .../plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp index 3d3af6929dd..c055cbb1fae 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6.cpp @@ -342,6 +342,7 @@ void QWaylandXdgSurfaceV6::zxdg_surface_v6_configure(uint32_t serial) if (!m_configured) { // We have to do the initial applyConfigure() immediately, since that is the expose. applyConfigure(); + m_exposeRegion = QRegion(QRect(QPoint(), m_window->geometry().size())); } else { // Later configures are probably resizes, so we have to queue them up for a time when we // are not painting to the window. diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index c723192c8e0..014b6bed5f2 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -376,6 +376,7 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) if (!m_configured) { // We have to do the initial applyConfigure() immediately, since that is the expose. applyConfigure(); + m_exposeRegion = QRegion(QRect(QPoint(), m_window->geometry().size())); } else { // Later configures are probably resizes, so we have to queue them up for a time when we // are not painting to the window. From 70b5d99bc2aff716b5329276211bf8295cc226bc Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 7 Nov 2018 11:23:44 +0100 Subject: [PATCH 2/4] Only print deprecation warning when using deprecated shells 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 --- .../wl-shell/qwaylandwlshellintegration.cpp | 8 ++++---- .../xdg-shell-v5/qwaylandxdgshellv5integration.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp index 008da3d8a83..1edb24b3c01 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellintegration.cpp @@ -49,10 +49,6 @@ namespace QtWaylandClient { bool QWaylandWlShellIntegration::initialize(QWaylandDisplay *display) { - qCWarning(lcQpaWayland) << "\"wl-shell\" is a deprecated shell extension, prefer using" - << "\"xdg-shell-v6\" or \"xdg-shell\" if supported by the compositor" - << "by setting the environment variable QT_WAYLAND_SHELL_INTEGRATION"; - Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) { if (global.interface == QLatin1String("wl_shell")) { m_wlShell = new QtWayland::wl_shell(display->wl_registry(), global.id, 1); @@ -65,6 +61,10 @@ bool QWaylandWlShellIntegration::initialize(QWaylandDisplay *display) return false; } + qCWarning(lcQpaWayland) << "\"wl-shell\" is a deprecated shell extension, prefer using" + << "\"xdg-shell-v6\" or \"xdg-shell\" if supported by the compositor" + << "by setting the environment variable QT_WAYLAND_SHELL_INTEGRATION"; + return QWaylandShellIntegration::initialize(display); } diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration.cpp index d032002b159..12cc95b1538 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5integration.cpp @@ -51,10 +51,6 @@ namespace QtWaylandClient { bool QWaylandXdgShellV5Integration::initialize(QWaylandDisplay *display) { - qCWarning(lcQpaWayland) << "\"xdg-shell-v5\" is a deprecated shell extension, prefer using" - << "\"xdg-shell-v6\" or \"xdg-shell\" if supported by the compositor" - << "by setting the environment variable QT_WAYLAND_SHELL_INTEGRATION"; - Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) { if (global.interface == QLatin1String("xdg_shell")) { m_xdgShell.reset(new QWaylandXdgShellV5(display->wl_registry(), global.id)); @@ -67,6 +63,10 @@ bool QWaylandXdgShellV5Integration::initialize(QWaylandDisplay *display) return false; } + qCWarning(lcQpaWayland) << "\"xdg-shell-v5\" is a deprecated shell extension, prefer using" + << "\"xdg-shell-v6\" or \"xdg-shell\" if supported by the compositor" + << "by setting the environment variable QT_WAYLAND_SHELL_INTEGRATION"; + return QWaylandShellIntegration::initialize(display); } From 130a6d7e605ad89dedaa1a95538f2fbae09aafc9 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 3 Dec 2018 16:12:09 +0200 Subject: [PATCH 3/4] Fix compilation with gcc 4.8 GCC 4.8 doesn't like QPointers in signal connections. Also, Default Member Initializers for aggregates are C++14, so we need to write a constructor to make a class with DMIs work in C++11. Change-Id: I567c60a8081fa2f268517ec747bd6534674bcce5 Reviewed-by: Simon Hausmann --- src/plugins/platforms/wayland/qwaylanddisplay_p.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 0dd8d7affb8..43ccc0a96e1 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -195,6 +195,11 @@ private: void requestWaylandSync(); struct Listener { + Listener() = default; + Listener(RegistryListener incomingListener, + void* incomingData) + : listener(incomingListener), data(incomingData) + {} RegistryListener listener = nullptr; void *data = nullptr; }; From a3e23fe5609ed1a8ec20196d3261bca8e6a60a6f Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 5 Dec 2018 10:03:29 +0100 Subject: [PATCH 4/4] Scanner: Add include for QList QList is not included when built with QT_NO_QOBJECT defined. Change-Id: Iaf8874583e81b08a49ec246a5de0b62803c8ed7e Reviewed-by: Sami Nurmenniemi Reviewed-by: Liang Qi --- src/tools/qtwaylandscanner/qtwaylandscanner.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp index 57f3f1a9f20..6f4a33b5f6b 100644 --- a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp @@ -40,6 +40,7 @@ #include #include #include +#include class Scanner {