From c4bd9198b4a0fac809903dd2c09276c2c3c1b22e Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 27 Feb 2018 11:32:15 +0100 Subject: Init variables where they are declared when possible (clang-tidy) 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 --- .../client-common/customextension.cpp | 1 - .../client-common/customextension.h | 2 +- examples/wayland/minimal-cpp/compositor.cpp | 3 +- examples/wayland/minimal-cpp/compositor.h | 4 +- examples/wayland/minimal-cpp/window.cpp | 1 - examples/wayland/minimal-cpp/window.h | 2 +- examples/wayland/qwindow-compositor/compositor.cpp | 10 +---- examples/wayland/qwindow-compositor/compositor.h | 16 +++---- examples/wayland/qwindow-compositor/window.cpp | 4 -- examples/wayland/qwindow-compositor/window.h | 8 ++-- .../compositor/sharebufferextension.cpp | 2 - .../compositor/sharebufferextension.h | 4 +- examples/wayland/server-buffer/cpp-client/main.cpp | 3 +- src/client/global/qwaylandclientextension.cpp | 4 -- src/client/global/qwaylandclientextension_p.h | 7 ++- .../qwaylandserverbufferintegration.cpp | 1 - .../qwaylandserverbufferintegration_p.h | 2 +- src/client/qwaylandabstractdecoration.cpp | 14 +++--- src/client/qwaylandbuffer.cpp | 2 - src/client/qwaylandbuffer_p.h | 4 +- src/client/qwaylanddatadevice.cpp | 5 --- src/client/qwaylanddatadevice_p.h | 6 +-- src/client/qwaylanddataoffer.cpp | 3 +- src/client/qwaylanddisplay.cpp | 14 ------ src/client/qwaylanddisplay_p.h | 6 +-- src/client/qwaylandinputcontext.cpp | 13 +----- src/client/qwaylandinputcontext_p.h | 10 ++--- src/client/qwaylandinputdevice.cpp | 3 +- src/client/qwaylandintegration.cpp | 7 +-- src/client/qwaylandintegration_p.h | 6 +-- src/client/qwaylandscreen.cpp | 12 +----- src/client/qwaylandscreen_p.h | 16 +++---- src/client/qwaylandshmbackingstore.cpp | 6 --- src/client/qwaylandshmbackingstore_p.h | 12 +++--- src/client/qwaylandsubsurface.cpp | 1 - src/client/qwaylandsubsurface_p.h | 2 +- src/client/qwaylandwindow.cpp | 18 +------- src/client/qwaylandwindow_p.h | 39 ++++++++--------- src/client/qwaylandwindowmanagerintegration.cpp | 8 ++-- src/client/qwaylandwlshellintegration.cpp | 1 - src/client/qwaylandwlshellintegration_p.h | 2 +- src/client/qwaylandwlshellsurface.cpp | 3 -- src/client/qwaylandwlshellsurface_p.h | 6 +-- src/client/qwaylandxdgpopup.cpp | 1 - src/client/qwaylandxdgpopup_p.h | 2 +- src/client/qwaylandxdgshell.cpp | 2 - src/client/qwaylandxdgshell_p.h | 2 +- src/client/qwaylandxdgshellintegration.cpp | 1 - src/client/qwaylandxdgshellintegration_p.h | 2 +- src/client/qwaylandxdgshellv6.cpp | 3 -- src/client/qwaylandxdgshellv6_p.h | 6 +-- src/client/qwaylandxdgshellv6integration.cpp | 1 - src/client/qwaylandxdgshellv6integration_p.h | 2 +- src/client/qwaylandxdgsurface.cpp | 5 --- src/client/qwaylandxdgsurface_p.h | 10 ++--- .../compositor_api/qwaylandcompositor.cpp | 9 ---- .../compositor_api/qwaylandcompositor_p.h | 10 ++--- .../compositor_api/qwaylandinputmethodcontrol.cpp | 4 +- .../compositor_api/qwaylandinputmethodcontrol_p.h | 8 ++-- src/compositor/compositor_api/qwaylandkeyboard.cpp | 17 +------- src/compositor/compositor_api/qwaylandkeyboard_p.h | 28 ++++++------ src/compositor/compositor_api/qwaylandoutput.cpp | 10 ----- src/compositor/compositor_api/qwaylandoutput_p.h | 26 +++++------ src/compositor/compositor_api/qwaylandpointer.cpp | 7 +-- src/compositor/compositor_api/qwaylandpointer_p.h | 10 ++--- .../compositor_api/qwaylandquickitem.cpp | 12 ++---- .../compositor_api/qwaylandquickitem_p.h | 39 ++++++----------- .../compositor_api/qwaylandquickoutput.cpp | 5 --- .../compositor_api/qwaylandquickoutput.h | 4 +- .../compositor_api/qwaylandquicksurface.cpp | 7 +-- src/compositor/compositor_api/qwaylandresource.cpp | 1 - src/compositor/compositor_api/qwaylandresource.h | 2 +- src/compositor/compositor_api/qwaylandseat.cpp | 16 ++----- src/compositor/compositor_api/qwaylandseat_p.h | 8 ++-- src/compositor/compositor_api/qwaylandsurface.cpp | 20 +-------- src/compositor/compositor_api/qwaylandsurface_p.h | 24 +++++------ src/compositor/compositor_api/qwaylandtouch.cpp | 3 +- src/compositor/compositor_api/qwaylandview_p.h | 24 ++++------- .../extensions/qwaylandiviapplication.cpp | 2 - src/compositor/extensions/qwaylandivisurface.cpp | 5 --- src/compositor/extensions/qwaylandivisurface_p.h | 6 +-- .../extensions/qwaylandqtwindowmanager.cpp | 3 -- .../extensions/qwaylandqtwindowmanager_p.h | 2 +- .../extensions/qwaylandquickshellsurfaceitem.cpp | 2 +- .../extensions/qwaylandquickshellsurfaceitem_p.h | 16 +++---- src/compositor/extensions/qwaylandshell.cpp | 2 - src/compositor/extensions/qwaylandshell_p.h | 2 +- src/compositor/extensions/qwaylandtextinput.cpp | 17 +------- src/compositor/extensions/qwaylandtextinput_p.h | 16 +++---- .../extensions/qwaylandtextinputmanager.cpp | 2 - src/compositor/extensions/qwaylandwlshell.cpp | 7 --- src/compositor/extensions/qwaylandwlshell_p.h | 4 +- .../extensions/qwaylandwlshellintegration.cpp | 4 -- .../extensions/qwaylandwlshellintegration_p.h | 8 ++-- src/compositor/extensions/qwaylandxdgshellv5.cpp | 16 +------ src/compositor/extensions/qwaylandxdgshellv5_p.h | 16 +++---- src/compositor/extensions/qwaylandxdgshellv6.cpp | 17 +------- src/compositor/extensions/qwaylandxdgshellv6_p.h | 24 +++++------ src/compositor/extensions/qwlqttouch.cpp | 2 - src/compositor/extensions/qwlqttouch_p.h | 2 +- .../global/qwaylandcompositorextension_p.h | 7 +-- .../qwlclientbufferintegration.cpp | 1 - .../qwlclientbufferintegration_p.h | 2 +- .../wayland_wrapper/qwlbuffermanager.cpp | 3 +- src/compositor/wayland_wrapper/qwlclientbuffer.cpp | 6 --- src/compositor/wayland_wrapper/qwlclientbuffer_p.h | 8 ++-- src/compositor/wayland_wrapper/qwldatadevice.cpp | 12 +----- src/compositor/wayland_wrapper/qwldatadevice_p.h | 14 +++--- .../wayland_wrapper/qwldatadevicemanager.cpp | 6 +-- .../wayland_wrapper/qwldatadevicemanager_p.h | 6 +-- src/compositor/wayland_wrapper/qwldatasource.cpp | 2 - src/compositor/wayland_wrapper/qwldatasource_p.h | 4 +- .../client/brcm-egl/qwaylandbrcmeglintegration.cpp | 1 - .../client/brcm-egl/qwaylandbrcmeglintegration.h | 2 +- .../client/brcm-egl/qwaylandbrcmeglwindow.cpp | 6 +-- .../client/brcm-egl/qwaylandbrcmeglwindow.h | 6 +-- .../drmeglserverbufferintegration.cpp | 3 +- .../libhybriseglserverbufferintegration.cpp | 1 - .../libhybriseglserverbufferintegration.h | 2 +- .../shmserverbufferintegration.cpp | 4 +- .../shmserverbufferintegration.h | 2 +- .../qwaylandeglclientbufferintegration.cpp | 3 -- .../qwaylandeglclientbufferintegration.h | 6 +-- .../client/wayland-egl/qwaylandeglwindow.cpp | 4 -- .../client/wayland-egl/qwaylandeglwindow.h | 8 ++-- .../client/wayland-egl/qwaylandglcontext.cpp | 3 -- .../client/wayland-egl/qwaylandglcontext.h | 6 +-- ...waylandxcompositeeglclientbufferintegration.cpp | 2 - .../qwaylandxcompositeeglclientbufferintegration.h | 4 +- .../xcomposite-egl/qwaylandxcompositeeglwindow.cpp | 3 -- .../xcomposite-egl/qwaylandxcompositeeglwindow.h | 6 +-- .../qwaylandxcompositeglxintegration.cpp | 5 --- .../qwaylandxcompositeglxintegration.h | 10 ++--- .../xcomposite-glx/qwaylandxcompositeglxwindow.cpp | 2 - .../xcomposite-glx/qwaylandxcompositeglxwindow.h | 4 +- .../compositor/brcm-egl/brcmbuffer.cpp | 1 - .../compositor/brcm-egl/brcmbuffer.h | 2 +- .../compositor/brcm-egl/brcmeglintegration.cpp | 14 ++---- .../compositor/brcm-egl/brcmeglintegration.h | 4 +- .../drmeglserverbufferintegration.cpp | 1 - .../drm-egl-server/drmeglserverbufferintegration.h | 2 +- .../libhybriseglserverbufferintegration.cpp | 1 - .../libhybriseglserverbufferintegration.h | 2 +- .../waylandeglclientbufferintegration.cpp | 50 +++++++--------------- .../xcomposite-egl/xcompositeeglintegration.cpp | 3 -- .../xcomposite-egl/xcompositeeglintegration.h | 4 +- .../xcomposite-glx/xcompositeglxintegration.cpp | 5 --- .../xcomposite-glx/xcompositeglxintegration.h | 8 ++-- src/imports/compositor/qwaylandmousetracker.cpp | 6 +-- src/plugins/decorations/bradient/main.cpp | 4 +- .../qwayland-egl/qwaylandeglplatformintegration.h | 3 +- .../qwaylandxcompositeeglplatformintegration.h | 3 +- .../qwaylandxcompositeglxplatformintegration.h | 3 +- .../ivi-shell/qwaylandivishellintegration.cpp | 6 --- .../ivi-shell/qwaylandivishellintegration.h | 12 +++--- .../ivi-shell/qwaylandivisurface.cpp | 2 - .../ivi-shell/qwaylandivisurface_p.h | 2 +- src/shared/qwaylandinputmethodeventbuilder.cpp | 10 ----- src/shared/qwaylandinputmethodeventbuilder_p.h | 12 +++--- tests/auto/client/client/tst_client.cpp | 27 ++++-------- tests/auto/client/shared/mockcompositor.cpp | 3 -- tests/auto/client/shared/mockcompositor.h | 6 +-- tests/auto/client/shared/mockinput.cpp | 15 ++----- tests/auto/client/shared/mockinput.h | 12 +++--- tests/auto/client/shared/mocksurface.cpp | 2 - tests/auto/client/shared/mocksurface.h | 4 +- tests/auto/compositor/compositor/mockclient.cpp | 9 ---- tests/auto/compositor/compositor/mockclient.h | 22 +++++----- .../auto/compositor/compositor/testcompositor.cpp | 3 +- 169 files changed, 385 insertions(+), 841 deletions(-) diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp index 41b4a30e9..90e1f4377 100644 --- a/examples/wayland/custom-extension/client-common/customextension.cpp +++ b/examples/wayland/custom-extension/client-common/customextension.cpp @@ -61,7 +61,6 @@ QT_BEGIN_NAMESPACE CustomExtension::CustomExtension() : QWaylandClientExtensionTemplate(/* Supported protocol version */ 1 ) - , m_activated(false) { connect(this, &CustomExtension::activeChanged, this, &CustomExtension::handleExtensionActive); } diff --git a/examples/wayland/custom-extension/client-common/customextension.h b/examples/wayland/custom-extension/client-common/customextension.h index 003a5a008..5e48ea75e 100644 --- a/examples/wayland/custom-extension/client-common/customextension.h +++ b/examples/wayland/custom-extension/client-common/customextension.h @@ -93,7 +93,7 @@ private: void sendWindowRegistration(QWindow *); QList m_windows; - bool m_activated; + bool m_activated = false; }; class CustomExtensionObject : public QWaylandClientExtensionTemplate diff --git a/examples/wayland/minimal-cpp/compositor.cpp b/examples/wayland/minimal-cpp/compositor.cpp index 52c2c2326..d32d8e888 100644 --- a/examples/wayland/minimal-cpp/compositor.cpp +++ b/examples/wayland/minimal-cpp/compositor.cpp @@ -66,8 +66,7 @@ bool View::isCursor() const } Compositor::Compositor(Window *window) - : QWaylandCompositor() - , m_window(window) + : m_window(window) { } diff --git a/examples/wayland/minimal-cpp/compositor.h b/examples/wayland/minimal-cpp/compositor.h index 76af25ecb..9dd5cb2f0 100644 --- a/examples/wayland/minimal-cpp/compositor.h +++ b/examples/wayland/minimal-cpp/compositor.h @@ -64,12 +64,12 @@ class View : public QWaylandView { Q_OBJECT public: - View() : m_texture(nullptr) {} + View() {} QOpenGLTexture *getTexture(); bool isCursor() const; private: friend class Compositor; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; }; class Compositor : public QWaylandCompositor diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp index 9de81e5f4..b84806472 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -58,7 +58,6 @@ #include Window::Window() - : m_compositor(nullptr) { } diff --git a/examples/wayland/minimal-cpp/window.h b/examples/wayland/minimal-cpp/window.h index 5396da15c..2a7a1109a 100644 --- a/examples/wayland/minimal-cpp/window.h +++ b/examples/wayland/minimal-cpp/window.h @@ -70,7 +70,7 @@ protected: private: QOpenGLTextureBlitter m_textureBlitter; - Compositor *m_compositor; + Compositor *m_compositor = nullptr; }; QT_END_NAMESPACE diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp index 11516a182..8ba8929e1 100644 --- a/examples/wayland/qwindow-compositor/compositor.cpp +++ b/examples/wayland/qwindow-compositor/compositor.cpp @@ -68,13 +68,6 @@ View::View(Compositor *compositor) : m_compositor(compositor) - , m_textureTarget(GL_TEXTURE_2D) - , m_texture(nullptr) - , m_wlShellSurface(nullptr) - , m_xdgSurface(nullptr) - , m_xdgPopup(nullptr) - , m_parentView(nullptr) - , m_animationFactor(1.0) {} QOpenGLTexture *View::getTexture() @@ -190,8 +183,7 @@ void View::onXdgUnsetFullscreen() } Compositor::Compositor(QWindow *window) - : QWaylandCompositor() - , m_window(window) + : m_window(window) , m_wlShell(new QWaylandWlShell(this)) , m_xdgShell(new QWaylandXdgShellV5(this)) { diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h index b0fc0c84e..d1b501ff8 100644 --- a/examples/wayland/qwindow-compositor/compositor.h +++ b/examples/wayland/qwindow-compositor/compositor.h @@ -96,18 +96,18 @@ protected: private: friend class Compositor; - Compositor *m_compositor; - GLenum m_textureTarget; - QOpenGLTexture *m_texture; + Compositor *m_compositor = nullptr; + GLenum m_textureTarget = GL_TEXTURE_2D; + QOpenGLTexture *m_texture = nullptr; QOpenGLTextureBlitter::Origin m_origin; QPointF m_position; QSize m_size; - QWaylandWlShellSurface *m_wlShellSurface; - QWaylandXdgSurfaceV5 *m_xdgSurface; - QWaylandXdgPopupV5 *m_xdgPopup; - View *m_parentView; + QWaylandWlShellSurface *m_wlShellSurface = nullptr; + QWaylandXdgSurfaceV5 *m_xdgSurface = nullptr; + QWaylandXdgPopupV5 *m_xdgPopup = nullptr; + View *m_parentView = nullptr; QPoint m_offset; - qreal m_animationFactor; + qreal m_animationFactor = 1.0; QBasicTimer m_animationTimer; bool m_animationCountUp; diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp index 9d5b4395e..80aeec4c3 100644 --- a/examples/wayland/qwindow-compositor/window.cpp +++ b/examples/wayland/qwindow-compositor/window.cpp @@ -60,10 +60,6 @@ #include Window::Window() - : m_backgroundTexture(nullptr) - , m_compositor(nullptr) - , m_grabState(NoGrab) - , m_dragIconView(nullptr) { } diff --git a/examples/wayland/qwindow-compositor/window.h b/examples/wayland/qwindow-compositor/window.h index d11553151..c16e726bf 100644 --- a/examples/wayland/qwindow-compositor/window.h +++ b/examples/wayland/qwindow-compositor/window.h @@ -96,17 +96,17 @@ private: QOpenGLTextureBlitter m_textureBlitter; QSize m_backgroundImageSize; - QOpenGLTexture *m_backgroundTexture; - Compositor *m_compositor; + QOpenGLTexture *m_backgroundTexture = nullptr; + Compositor *m_compositor = nullptr; QPointer m_mouseView; - GrabState m_grabState; + GrabState m_grabState = NoGrab; QSize m_initialSize; int m_resizeEdge; bool m_resizeAnchored; QPointF m_resizeAnchorPosition; QPointF m_mouseOffset; QPointF m_initialMousePos; - View *m_dragIconView; + View *m_dragIconView = nullptr; }; QT_END_NAMESPACE diff --git a/examples/wayland/server-buffer/compositor/sharebufferextension.cpp b/examples/wayland/server-buffer/compositor/sharebufferextension.cpp index 8277dad34..71731ed22 100644 --- a/examples/wayland/server-buffer/compositor/sharebufferextension.cpp +++ b/examples/wayland/server-buffer/compositor/sharebufferextension.cpp @@ -61,8 +61,6 @@ ShareBufferExtension::ShareBufferExtension(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) - , m_server_buffer_integration(nullptr) - , m_server_buffers_created(false) { } diff --git a/examples/wayland/server-buffer/compositor/sharebufferextension.h b/examples/wayland/server-buffer/compositor/sharebufferextension.h index f84d9c4df..4719844b3 100644 --- a/examples/wayland/server-buffer/compositor/sharebufferextension.h +++ b/examples/wayland/server-buffer/compositor/sharebufferextension.h @@ -89,8 +89,8 @@ protected: private: void createServerBuffers(); QList m_server_buffers; - QtWayland::ServerBufferIntegration *m_server_buffer_integration; - bool m_server_buffers_created; + QtWayland::ServerBufferIntegration *m_server_buffer_integration = nullptr; + bool m_server_buffers_created = false; }; Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(ShareBufferExtension) diff --git a/examples/wayland/server-buffer/cpp-client/main.cpp b/examples/wayland/server-buffer/cpp-client/main.cpp index b0b3712b9..7ff34072b 100644 --- a/examples/wayland/server-buffer/cpp-client/main.cpp +++ b/examples/wayland/server-buffer/cpp-client/main.cpp @@ -73,7 +73,6 @@ class TestWindow : public QOpenGLWindow public: TestWindow() - : m_extension(nullptr) { m_extension = new ShareBufferExtension; connect(m_extension, SIGNAL(bufferReceived(QtWaylandClient::QWaylandServerBuffer*)), this, SLOT(receiveBuffer(QtWaylandClient::QWaylandServerBuffer*))); @@ -118,7 +117,7 @@ protected: private: QOpenGLTextureBlitter *m_blitter; - ShareBufferExtension *m_extension; + ShareBufferExtension *m_extension = nullptr; QList m_buffers; }; diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp index 60a8944f8..125b1e19d 100644 --- a/src/client/global/qwaylandclientextension.cpp +++ b/src/client/global/qwaylandclientextension.cpp @@ -49,10 +49,6 @@ QT_BEGIN_NAMESPACE QWaylandClientExtensionPrivate::QWaylandClientExtensionPrivate() - : QObjectPrivate() - , waylandIntegration(nullptr) - , version(-1) - , active(false) { // Keep the possibility to use a custom waylandIntegration as a plugin, // but also add the possibility to run it as a QML component. diff --git a/src/client/global/qwaylandclientextension_p.h b/src/client/global/qwaylandclientextension_p.h index 0fd59b3f7..69cc46a0a 100644 --- a/src/client/global/qwaylandclientextension_p.h +++ b/src/client/global/qwaylandclientextension_p.h @@ -65,16 +65,15 @@ public: static void handleRegistryGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); - QtWaylandClient::QWaylandIntegration *waylandIntegration; - int version; - bool active; + QtWaylandClient::QWaylandIntegration *waylandIntegration = nullptr; + int version = -1; + bool active = false; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtensionTemplatePrivate : public QWaylandClientExtensionPrivate { public: QWaylandClientExtensionTemplatePrivate() - : QWaylandClientExtensionPrivate() { } }; diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp index 013ddae9f..d966a1919 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandServerBuffer::QWaylandServerBuffer() - : m_user_data(nullptr) { } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h index 3b8b3a6de..7439087d8 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h @@ -89,7 +89,7 @@ protected: QSize m_size; private: - void *m_user_data; + void *m_user_data = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp index 6a7a2ef4c..c20b70e9e 100644 --- a/src/client/qwaylandabstractdecoration.cpp +++ b/src/client/qwaylandabstractdecoration.cpp @@ -60,21 +60,17 @@ public: QWaylandAbstractDecorationPrivate(); ~QWaylandAbstractDecorationPrivate(); - QWindow *m_window; - QWaylandWindow *m_wayland_window; + QWindow *m_window = nullptr; + QWaylandWindow *m_wayland_window = nullptr; - bool m_isDirty; + bool m_isDirty = true; QImage m_decorationContentImage; - Qt::MouseButtons m_mouseButtons; + Qt::MouseButtons m_mouseButtons = Qt::NoButton; }; QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate() - : m_window(nullptr) - , m_wayland_window(nullptr) - , m_isDirty(true) - , m_decorationContentImage(nullptr) - , m_mouseButtons(Qt::NoButton) + : m_decorationContentImage(nullptr) { } diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index 2dc99b3b7..9792cdd61 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -47,8 +47,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBuffer::QWaylandBuffer() - : mBuffer(nullptr) - , mBusy(false) { } diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index 9e8cba2e4..156ea9530 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -77,10 +77,10 @@ public: bool busy() const { return mBusy; } protected: - struct wl_buffer *mBuffer; + struct wl_buffer *mBuffer = nullptr; private: - bool mBusy; + bool mBusy = false; static void release(void *data, wl_buffer *); static const wl_buffer_listener listener; diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 83912035a..4411ba65c 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -66,11 +66,6 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl : QtWayland::wl_data_device(manager->get_data_device(inputDevice->wl_seat())) , m_display(manager->display()) , m_inputDevice(inputDevice) - , m_enterSerial(0) - , m_dragWindow(nullptr) - , m_dragPoint() - , m_dragOffer() - , m_selectionOffer() { } diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 7fb0003b4..29461930b 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -117,9 +117,9 @@ private: QPoint calculateDragPosition(int x, int y, QWindow *wnd) const; #endif - QWaylandDisplay *m_display; - QWaylandInputDevice *m_inputDevice; - uint32_t m_enterSerial; + QWaylandDisplay *m_display = nullptr; + QWaylandInputDevice *m_inputDevice = nullptr; + uint32_t m_enterSerial = 0; QPointer m_dragWindow; QPoint m_dragPoint; QScopedPointer m_dragOffer; diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp index 2491c658b..35085a7f0 100644 --- a/src/client/qwaylanddataoffer.cpp +++ b/src/client/qwaylanddataoffer.cpp @@ -87,8 +87,7 @@ void QWaylandDataOffer::data_offer_offer(const QString &mime_type) } QWaylandMimeData::QWaylandMimeData(QWaylandDataOffer *dataOffer, QWaylandDisplay *display) - : QInternalMimeData() - , m_dataOffer(dataOffer) + : m_dataOffer(dataOffer) , m_display(display) { } diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 179c0454e..abb084522 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -124,20 +124,6 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) -#if QT_CONFIG(wayland_datadevice) - , mDndSelectionHandler(nullptr) -#endif - , mWindowExtension(nullptr) - , mSubCompositor(nullptr) - , mTouchExtension(nullptr) - , mQtKeyExtension(nullptr) - , mTextInputManager(nullptr) - , mHardwareIntegration(nullptr) - , mLastInputSerial(0) - , mLastInputDevice(nullptr) - , mLastInputWindow(nullptr) - , mLastKeyboardFocus(nullptr) - , mSyncCallback(nullptr) { qRegisterMetaType("uint32_t"); diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 35d861760..0a7ea427a 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -217,12 +217,12 @@ private: int mWritableNotificationFd; QList mGlobals; int mCompositorVersion; - uint32_t mLastInputSerial; - QWaylandInputDevice *mLastInputDevice; + uint32_t mLastInputSerial = 0; + QWaylandInputDevice *mLastInputDevice = nullptr; QPointer mLastInputWindow; QPointer mLastKeyboardFocus; QVector mActiveWindows; - struct wl_callback *mSyncCallback; + struct wl_callback *mSyncCallback = nullptr; static const wl_callback_listener syncCallbackListener; void registry_global(uint32_t id, const QString &interface, uint32_t version) override; diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index 16ee057c5..58ad90d41 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -71,15 +71,6 @@ const Qt::InputMethodQueries supportedQueries = Qt::ImEnabled | QWaylandTextInput::QWaylandTextInput(QWaylandDisplay *display, struct ::zwp_text_input_v2 *text_input) : QtWayland::zwp_text_input_v2(text_input) , m_display(display) - , m_builder() - , m_serial(0) - , m_surface(nullptr) - , m_preeditCommit() - , m_inputPanelVisible(false) - , m_keyboardRectangle() - , m_locale() - , m_inputDirection(Qt::LayoutDirectionAuto) - , m_resetCallback(nullptr) { } @@ -391,9 +382,7 @@ Qt::KeyboardModifiers QWaylandTextInput::modifiersToQtModifiers(uint32_t modifie } QWaylandInputContext::QWaylandInputContext(QWaylandDisplay *display) - : QPlatformInputContext() - , mDisplay(display) - , mCurrentWindow() + : mDisplay(display) { } diff --git a/src/client/qwaylandinputcontext_p.h b/src/client/qwaylandinputcontext_p.h index a131bc5bd..a554f2301 100644 --- a/src/client/qwaylandinputcontext_p.h +++ b/src/client/qwaylandinputcontext_p.h @@ -112,17 +112,17 @@ private: QVector m_modifiersMap; - uint32_t m_serial; - struct ::wl_surface *m_surface; + uint32_t m_serial = 0; + struct ::wl_surface *m_surface = nullptr; QString m_preeditCommit; - bool m_inputPanelVisible; + bool m_inputPanelVisible = false; QRectF m_keyboardRectangle; QLocale m_locale; - Qt::LayoutDirection m_inputDirection; + Qt::LayoutDirection m_inputDirection = Qt::LayoutDirectionAuto; - struct ::wl_callback *m_resetCallback; + struct ::wl_callback *m_resetCallback = nullptr; static const wl_callback_listener callbackListener; static void resetCallback(void *data, struct wl_callback *wl_callback, uint32_t time); }; diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index b34504a1f..93344d13f 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -200,8 +200,7 @@ QWaylandInputDevice::Touch::~Touch() } QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version, uint32_t id) - : QObject() - , QtWayland::wl_seat(display->wl_registry(), id, qMin(version, 4)) + : QtWayland::wl_seat(display->wl_registry(), id, qMin(version, 4)) , mQDisplay(display) , mDisplay(display->wl_display()) , mVersion(qMin(version, 4)) diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 267e481ac..fe1655c9f 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -121,16 +121,11 @@ public: }; QWaylandIntegration::QWaylandIntegration() - : mClientBufferIntegration(nullptr) - , mInputDeviceIntegration(nullptr) - , mFontDb(new QGenericUnixFontDatabase()) + : mFontDb(new QGenericUnixFontDatabase()) , mNativeInterface(new QWaylandNativeInterface(this)) #if QT_CONFIG(accessibility) , mAccessibility(new QPlatformAccessibility()) #endif - , mClientBufferIntegrationInitialized(false) - , mServerBufferIntegrationInitialized(false) - , mShellIntegrationInitialized(false) { initializeInputDeviceIntegration(); mDisplay.reset(new QWaylandDisplay(this)); diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index 17144b8d7..7ce79e6da 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -147,9 +147,9 @@ private: QScopedPointer mAccessibility; #endif bool mFailed = false; - bool mClientBufferIntegrationInitialized; - bool mServerBufferIntegrationInitialized; - bool mShellIntegrationInitialized; + bool mClientBufferIntegrationInitialized = false; + bool mServerBufferIntegrationInitialized = false; + bool mShellIntegrationInitialized = false; friend class QWaylandDisplay; }; diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 1c9ce23ba..38d97a91d 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -53,20 +53,10 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id) - : QPlatformScreen() - , QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2)) + : QtWayland::wl_output(waylandDisplay->wl_registry(), id, qMin(version, 2)) , m_outputId(id) , mWaylandDisplay(waylandDisplay) - , mScale(1) - , mDepth(32) - , mRefreshRate(60000) - , mTransform(-1) - , mFormat(QImage::Format_ARGB32_Premultiplied) , mOutputName(QStringLiteral("Screen%1").arg(id)) - , m_orientation(Qt::PrimaryOrientation) -#if QT_CONFIG(cursor) - , mWaylandCursor(nullptr) -#endif { } diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index 674e1a913..37c35cfff 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -116,21 +116,21 @@ private: void output_done() override; int m_outputId; - QWaylandDisplay *mWaylandDisplay; + QWaylandDisplay *mWaylandDisplay = nullptr; QString mManufacturer; QString mModel; QRect mGeometry; - int mScale; - int mDepth; - int mRefreshRate; - int mTransform; - QImage::Format mFormat; + int mScale = 1; + int mDepth = 32; + int mRefreshRate = 60000; + int mTransform = -1; + QImage::Format mFormat = QImage::Format_ARGB32_Premultiplied; QSize mPhysicalSize; QString mOutputName; - Qt::ScreenOrientation m_orientation; + Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; #if QT_CONFIG(cursor) - QWaylandCursor *mWaylandCursor; + QWaylandCursor *mWaylandCursor = nullptr; #endif }; diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 24554ee44..cbfdf5157 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -72,9 +72,6 @@ Q_LOGGING_CATEGORY(logCategory, "qt.qpa.wayland.backingstore") QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale) - : QWaylandBuffer() - , mShmPool(nullptr) - , mMarginsImage(nullptr) { int stride = size.width() * 4; int alloc = stride * size.height(); @@ -161,9 +158,6 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn) QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window) : QPlatformBackingStore(window) , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display()) - , mFrontBuffer(nullptr) - , mBackBuffer(nullptr) - , mPainting(false) { } diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 251368efd..628d1858b 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -79,9 +79,9 @@ public: QImage *imageInsideMargins(const QMargins &margins); private: QImage mImage; - struct wl_shm_pool *mShmPool; + struct wl_shm_pool *mShmPool = nullptr; QMargins mMargins; - QImage *mMarginsImage; + QImage *mMarginsImage = nullptr; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandShmBackingStore : public QPlatformBackingStore @@ -115,11 +115,11 @@ private: void updateDecorations(); QWaylandShmBuffer *getBuffer(const QSize &size); - QWaylandDisplay *mDisplay; + QWaylandDisplay *mDisplay = nullptr; QLinkedList mBuffers; - QWaylandShmBuffer *mFrontBuffer; - QWaylandShmBuffer *mBackBuffer; - bool mPainting; + QWaylandShmBuffer *mFrontBuffer = nullptr; + QWaylandShmBuffer *mBackBuffer = nullptr; + bool mPainting = false; QMutex mMutex; QSize mRequestedSize; diff --git a/src/client/qwaylandsubsurface.cpp b/src/client/qwaylandsubsurface.cpp index 36fdd1c7a..2ff966cbc 100644 --- a/src/client/qwaylandsubsurface.cpp +++ b/src/client/qwaylandsubsurface.cpp @@ -51,7 +51,6 @@ QWaylandSubSurface::QWaylandSubSurface(QWaylandWindow *window, QWaylandWindow *p : QtWayland::wl_subsurface(sub_surface) , m_window(window) , m_parent(parent) - , m_synchronized(false) { m_parent->mChildren << this; setDeSync(); diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h index 00fb8d8ed..36a92a755 100644 --- a/src/client/qwaylandsubsurface_p.h +++ b/src/client/qwaylandsubsurface_p.h @@ -88,7 +88,7 @@ private: void set_desync(); QWaylandWindow *m_window; QWaylandWindow *m_parent; - bool m_synchronized; + bool m_synchronized = false; QMutex m_syncLock; }; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 75dfaa499..52461dc38 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -78,25 +78,9 @@ namespace QtWaylandClient { QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; QWaylandWindow::QWaylandWindow(QWindow *window) - : QObject() - , QPlatformWindow(window) + : QPlatformWindow(window) , mDisplay(waylandScreen()->display()) - , mShellSurface(nullptr) - , mSubSurfaceWindow(nullptr) - , mWindowDecoration(nullptr) - , mMouseEventsInContentArea(false) - , mMousePressedInContentArea(Qt::NoButton) - , mWaitingForFrameSync(false) - , mRequestResizeSent(false) - , mCanResize(true) - , mResizeDirty(false) , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP")) - , mSentInitialResize(false) - , mScale(1) - , mState(Qt::WindowNoState) - , mMask() - , mBackingStore(nullptr) - , mUpdateRequested(false) { static WId id = 1; mWindowId = id++; diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index fca96f30d..a74f18827 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -81,9 +81,6 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowConfigure { public: QWaylandWindowConfigure() - : width(0) - , height(0) - , edges(0) { } void clear() @@ -92,9 +89,9 @@ public: bool isEmpty() const { return !height || !width; } - int width; - int height; - uint32_t edges; + int width = 0; + int height = 0; + uint32_t edges = 0; }; class Q_WAYLAND_CLIENT_EXPORT QWaylandWindow : public QObject, public QPlatformWindow, public QtWayland::wl_surface @@ -214,39 +211,39 @@ protected: void surface_leave(struct ::wl_output *output) override; QVector mScreens; //As seen by wl_surface.enter/leave events. Chronological order. - QWaylandDisplay *mDisplay; - QWaylandShellSurface *mShellSurface; - QWaylandSubSurface *mSubSurfaceWindow; + QWaylandDisplay *mDisplay = nullptr; + QWaylandShellSurface *mShellSurface = nullptr; + QWaylandSubSurface *mSubSurfaceWindow = nullptr; QVector mChildren; - QWaylandAbstractDecoration *mWindowDecoration; - bool mMouseEventsInContentArea; - Qt::MouseButtons mMousePressedInContentArea; + QWaylandAbstractDecoration *mWindowDecoration = nullptr; + bool mMouseEventsInContentArea = false; + Qt::MouseButtons mMousePressedInContentArea = Qt::NoButton; WId mWindowId; - bool mWaitingForFrameSync; + bool mWaitingForFrameSync = false; struct ::wl_callback *mFrameCallback = nullptr; QWaitCondition mFrameSyncWait; QMutex mResizeLock; QWaylandWindowConfigure mConfigure; - bool mRequestResizeSent; - bool mCanResize; - bool mResizeDirty; + bool mRequestResizeSent = false; + bool mCanResize = true; + bool mResizeDirty = false; bool mResizeAfterSwap; QVariantMap m_properties; - bool mSentInitialResize; + bool mSentInitialResize = false; QPoint mOffset; - int mScale; + int mScale = 1; QIcon mWindowIcon; - Qt::WindowStates mState; + Qt::WindowStates mState = Qt::WindowNoState; Qt::WindowFlags mFlags; QRegion mMask; - QWaylandShmBackingStore *mBackingStore; + QWaylandShmBackingStore *mBackingStore = nullptr; private slots: void handleScreenRemoved(QScreen *qScreen); @@ -266,7 +263,7 @@ private: void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e); void handleScreenChanged(); - bool mUpdateRequested; + bool mUpdateRequested = false; static const wl_callback_listener callbackListener; static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); diff --git a/src/client/qwaylandwindowmanagerintegration.cpp b/src/client/qwaylandwindowmanagerintegration.cpp index c519126e5..785a0a44d 100644 --- a/src/client/qwaylandwindowmanagerintegration.cpp +++ b/src/client/qwaylandwindowmanagerintegration.cpp @@ -60,16 +60,14 @@ namespace QtWaylandClient { class QWaylandWindowManagerIntegrationPrivate { public: QWaylandWindowManagerIntegrationPrivate(QWaylandDisplay *waylandDisplay); - bool m_blockPropertyUpdates; + bool m_blockPropertyUpdates = false; QWaylandDisplay *m_waylandDisplay; QHash m_queuedProperties; - bool m_showIsFullScreen; + bool m_showIsFullScreen = false; }; QWaylandWindowManagerIntegrationPrivate::QWaylandWindowManagerIntegrationPrivate(QWaylandDisplay *waylandDisplay) - : m_blockPropertyUpdates(false) - , m_waylandDisplay(waylandDisplay) - , m_showIsFullScreen(false) + : m_waylandDisplay(waylandDisplay) { } diff --git a/src/client/qwaylandwlshellintegration.cpp b/src/client/qwaylandwlshellintegration.cpp index e51637108..81c46be29 100644 --- a/src/client/qwaylandwlshellintegration.cpp +++ b/src/client/qwaylandwlshellintegration.cpp @@ -55,7 +55,6 @@ QWaylandWlShellIntegration *QWaylandWlShellIntegration::create(QWaylandDisplay * } QWaylandWlShellIntegration::QWaylandWlShellIntegration(QWaylandDisplay *display) - : m_wlShell(nullptr) { Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) { if (global.interface == QLatin1String("wl_shell")) { diff --git a/src/client/qwaylandwlshellintegration_p.h b/src/client/qwaylandwlshellintegration_p.h index 2e3ac3cc1..7a6b53524 100644 --- a/src/client/qwaylandwlshellintegration_p.h +++ b/src/client/qwaylandwlshellintegration_p.h @@ -70,7 +70,7 @@ public: private: QWaylandWlShellIntegration(QWaylandDisplay* display); - QtWayland::wl_shell *m_wlShell; + QtWayland::wl_shell *m_wlShell = nullptr; }; } diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 7c8d51721..00b070f3f 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -56,9 +56,6 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_ : QWaylandShellSurface(window) , QtWayland::wl_shell_surface(shell_surface) , m_window(window) - , m_maximized(false) - , m_fullscreen(false) - , m_extendedWindow(nullptr) { if (window->display()->windowExtension()) m_extendedWindow = new QWaylandExtendedSurface(window); diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h index 62583949b..708c6f113 100644 --- a/src/client/qwaylandwlshellsurface_p.h +++ b/src/client/qwaylandwlshellsurface_p.h @@ -105,10 +105,10 @@ private: void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, uint serial); QWaylandWindow *m_window; - bool m_maximized; - bool m_fullscreen; + bool m_maximized = false; + bool m_fullscreen = false; QSize m_size; - QWaylandExtendedSurface *m_extendedWindow; + QWaylandExtendedSurface *m_extendedWindow = nullptr; void shell_surface_ping(uint32_t serial) override; void shell_surface_configure(uint32_t edges, diff --git a/src/client/qwaylandxdgpopup.cpp b/src/client/qwaylandxdgpopup.cpp index d5fc49693..46a12a828 100644 --- a/src/client/qwaylandxdgpopup.cpp +++ b/src/client/qwaylandxdgpopup.cpp @@ -50,7 +50,6 @@ namespace QtWaylandClient { QWaylandXdgPopup::QWaylandXdgPopup(struct ::xdg_popup *popup, QWaylandWindow *window) : QWaylandShellSurface(window) , QtWayland::xdg_popup(popup) - , m_extendedWindow(nullptr) , m_window(window) { if (window->display()->windowExtension()) diff --git a/src/client/qwaylandxdgpopup_p.h b/src/client/qwaylandxdgpopup_p.h index f45e717a9..85bd589bf 100644 --- a/src/client/qwaylandxdgpopup_p.h +++ b/src/client/qwaylandxdgpopup_p.h @@ -80,7 +80,7 @@ protected: void xdg_popup_popup_done() override; private: - QWaylandExtendedSurface *m_extendedWindow; + QWaylandExtendedSurface *m_extendedWindow = nullptr; QWaylandWindow *m_window; }; diff --git a/src/client/qwaylandxdgshell.cpp b/src/client/qwaylandxdgshell.cpp index 6a9930608..8b252b953 100644 --- a/src/client/qwaylandxdgshell.cpp +++ b/src/client/qwaylandxdgshell.cpp @@ -54,13 +54,11 @@ namespace QtWaylandClient { QWaylandXdgShell::QWaylandXdgShell(struct ::xdg_shell *shell) : QtWayland::xdg_shell(shell) - , m_popupSerial(0) { } QWaylandXdgShell::QWaylandXdgShell(struct ::wl_registry *registry, uint32_t id) : QtWayland::xdg_shell(registry, id, 1) - , m_popupSerial(0) { use_unstable_version(QtWayland::xdg_shell::version_current); } diff --git a/src/client/qwaylandxdgshell_p.h b/src/client/qwaylandxdgshell_p.h index f462f2828..e01104cad 100644 --- a/src/client/qwaylandxdgshell_p.h +++ b/src/client/qwaylandxdgshell_p.h @@ -85,7 +85,7 @@ private: void xdg_shell_ping(uint32_t serial) override; QVector m_popups; - uint m_popupSerial; + uint m_popupSerial = 0; }; QT_END_NAMESPACE diff --git a/src/client/qwaylandxdgshellintegration.cpp b/src/client/qwaylandxdgshellintegration.cpp index 7c40d2dd7..5fa4385d6 100644 --- a/src/client/qwaylandxdgshellintegration.cpp +++ b/src/client/qwaylandxdgshellintegration.cpp @@ -57,7 +57,6 @@ QWaylandXdgShellIntegration *QWaylandXdgShellIntegration::create(QWaylandDisplay } QWaylandXdgShellIntegration::QWaylandXdgShellIntegration(QWaylandDisplay *display) - : m_xdgShell(nullptr) { Q_FOREACH (QWaylandDisplay::RegistryGlobal global, display->globals()) { if (global.interface == QLatin1String("xdg_shell")) { diff --git a/src/client/qwaylandxdgshellintegration_p.h b/src/client/qwaylandxdgshellintegration_p.h index cc4493e3e..ed307a5de 100644 --- a/src/client/qwaylandxdgshellintegration_p.h +++ b/src/client/qwaylandxdgshellintegration_p.h @@ -72,7 +72,7 @@ public: private: QWaylandXdgShellIntegration(QWaylandDisplay *display); - QWaylandXdgShell *m_xdgShell; + QWaylandXdgShell *m_xdgShell = nullptr; }; } diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index 1a60d6533..69bbf55b8 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -117,9 +117,6 @@ QWaylandXdgSurfaceV6::QWaylandXdgSurfaceV6(QWaylandXdgShellV6 *shell, ::zxdg_sur , zxdg_surface_v6(surface) , m_shell(shell) , m_window(window) - , m_toplevel(nullptr) - , m_popup(nullptr) - , m_configured(false) { } diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/client/qwaylandxdgshellv6_p.h index 769f19837..122beed0c 100644 --- a/src/client/qwaylandxdgshellv6_p.h +++ b/src/client/qwaylandxdgshellv6_p.h @@ -125,9 +125,9 @@ private: QWaylandXdgShellV6 *m_shell; QWaylandWindow *m_window; - Toplevel *m_toplevel; - Popup *m_popup; - bool m_configured; + Toplevel *m_toplevel = nullptr; + Popup *m_popup = nullptr; + bool m_configured = false; QRegion m_exposeRegion; }; diff --git a/src/client/qwaylandxdgshellv6integration.cpp b/src/client/qwaylandxdgshellv6integration.cpp index a3dca70bf..cb82354b6 100644 --- a/src/client/qwaylandxdgshellv6integration.cpp +++ b/src/client/qwaylandxdgshellv6integration.cpp @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandXdgShellV6Integration::QWaylandXdgShellV6Integration(QWaylandDisplay *display) - : m_xdgShell(nullptr) { for (QWaylandDisplay::RegistryGlobal global : display->globals()) { if (global.interface == QLatin1String("zxdg_shell_v6")) { diff --git a/src/client/qwaylandxdgshellv6integration_p.h b/src/client/qwaylandxdgshellv6integration_p.h index f22b6a66a..bdfd19723 100644 --- a/src/client/qwaylandxdgshellv6integration_p.h +++ b/src/client/qwaylandxdgshellv6integration_p.h @@ -71,7 +71,7 @@ public: private: QWaylandXdgShellV6Integration(QWaylandDisplay *display); - QWaylandXdgShellV6 *m_xdgShell; + QWaylandXdgShellV6 *m_xdgShell = nullptr; }; } diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index 60266af68..40ed9f07a 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.cpp @@ -57,11 +57,6 @@ QWaylandXdgSurface::QWaylandXdgSurface(QWaylandXdgShell *shell, QWaylandWindow * , QtWayland::xdg_surface(shell->get_xdg_surface(window->object())) , m_window(window) , m_shell(shell) - , m_maximized(false) - , m_minimized(false) - , m_fullscreen(false) - , m_active(false) - , m_extendedWindow(nullptr) { if (window->display()->windowExtension()) m_extendedWindow = new QWaylandExtendedSurface(window); diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 00154ade0..fa7963206 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -112,13 +112,13 @@ private: private: QWaylandWindow *m_window; QWaylandXdgShell* m_shell; - bool m_maximized; - bool m_minimized; - bool m_fullscreen; - bool m_active; + bool m_maximized = false; + bool m_minimized = false; + bool m_fullscreen = false; + bool m_active = false; QSize m_normalSize; QMargins m_margins; - QWaylandExtendedSurface *m_extendedWindow; + QWaylandExtendedSurface *m_extendedWindow = nullptr; void xdg_surface_configure(int32_t width, int32_t height, diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 289af2f38..ae5ed1ec1 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -148,15 +148,6 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(nullptr) -#if QT_CONFIG(opengl) - , use_hw_integration_extension(true) - , client_buffer_integration(nullptr) - , server_buffer_integration(nullptr) -#endif - , retainSelection(false) - , preInitialized(false) - , initialized(false) { if (QGuiApplication::platformNativeInterface()) display = static_cast(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); diff --git a/src/compositor/compositor_api/qwaylandcompositor_p.h b/src/compositor/compositor_api/qwaylandcompositor_p.h index 18595a806..b1959e68f 100644 --- a/src/compositor/compositor_api/qwaylandcompositor_p.h +++ b/src/compositor/compositor_api/qwaylandcompositor_p.h @@ -128,7 +128,7 @@ protected: void loadServerBufferIntegration(); QByteArray socket_name; - struct wl_display *display; + struct wl_display *display = nullptr; QList seats; QList outputs; @@ -147,7 +147,7 @@ protected: QList clients; #if QT_CONFIG(opengl) - bool use_hw_integration_extension; + bool use_hw_integration_extension = true; QScopedPointer hw_integration; QScopedPointer client_buffer_integration; QScopedPointer server_buffer_integration; @@ -155,9 +155,9 @@ protected: QScopedPointer eventHandler; - bool retainSelection; - bool preInitialized; - bool initialized; + bool retainSelection = false; + bool preInitialized = false; + bool initialized = false; QList > polish_objects; Q_DECLARE_PUBLIC(QWaylandCompositor) diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 69e5971eb..a443502fa 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -150,11 +150,9 @@ void QWaylandInputMethodControl::defaultSeatChanged() } QWaylandInputMethodControlPrivate::QWaylandInputMethodControlPrivate(QWaylandSurface *surface) - : QObjectPrivate() - , compositor(surface->compositor()) + : compositor(surface->compositor()) , seat(compositor->defaultSeat()) , surface(surface) - , enabled(false) { } diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h index aedff6486..337cf0087 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h @@ -72,10 +72,10 @@ public: QWaylandTextInput *textInput() const; - QWaylandCompositor *compositor; - QWaylandSeat *seat; - QWaylandSurface *surface; - bool enabled; + QWaylandCompositor *compositor = nullptr; + QWaylandSeat *seat = nullptr; + QWaylandSurface *surface = nullptr; + bool enabled = false; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index e35c0f371..7ab8bff9e 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -59,22 +59,7 @@ QT_BEGIN_NAMESPACE QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) - : QtWaylandServer::wl_keyboard() - , seat(seat) - , focus() - , focusResource() - , keys() - , modsDepressed() - , modsLatched() - , modsLocked() - , group() - , pendingKeymap(false) -#if QT_CONFIG(xkbcommon_evdev) - , keymap_fd(-1) - , xkb_state(nullptr) -#endif - , repeatRate(40) - , repeatDelay(400) + : seat(seat) { } diff --git a/src/compositor/compositor_api/qwaylandkeyboard_p.h b/src/compositor/compositor_api/qwaylandkeyboard_p.h index 0b47f8e8e..bcc4abb1a 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard_p.h +++ b/src/compositor/compositor_api/qwaylandkeyboard_p.h @@ -114,29 +114,29 @@ private: void sendRepeatInfo(); - QWaylandSeat *seat; + QWaylandSeat *seat = nullptr; - QWaylandSurface *focus; - Resource *focusResource; + QWaylandSurface *focus = nullptr; + Resource *focusResource = nullptr; QWaylandDestroyListener focusDestroyListener; QVector keys; - uint32_t modsDepressed; - uint32_t modsLatched; - uint32_t modsLocked; - uint32_t group; + uint32_t modsDepressed = 0; + uint32_t modsLatched = 0; + uint32_t modsLocked = 0; + uint32_t group = 0; - bool pendingKeymap; + bool pendingKeymap = false; #if QT_CONFIG(xkbcommon_evdev) size_t keymap_size; - int keymap_fd; - char *keymap_area; - struct xkb_context *xkb_context; - struct xkb_state *xkb_state; + int keymap_fd = -1; + char *keymap_area = nullptr; + struct xkb_context *xkb_context = nullptr; + struct xkb_state *xkb_state = nullptr; #endif - quint32 repeatRate; - quint32 repeatDelay; + quint32 repeatRate = 40; + quint32 repeatDelay = 400; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 7627195da..f7782da9c 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -104,16 +104,6 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput: } QWaylandOutputPrivate::QWaylandOutputPrivate() - : QtWaylandServer::wl_output() - , compositor(nullptr) - , window(nullptr) - , currentMode(-1) - , preferredMode(-1) - , subpixel(QWaylandOutput::SubpixelUnknown) - , transform(QWaylandOutput::TransformNormal) - , scaleFactor(1) - , sizeFollowsWindow(false) - , initialized(false) { } diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index 5a21c3de7..28a19ff89 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -70,15 +70,11 @@ QT_BEGIN_NAMESPACE struct QWaylandSurfaceViewMapper { QWaylandSurfaceViewMapper() - : surface(nullptr) - , views() - , has_entered(false) {} QWaylandSurfaceViewMapper(QWaylandSurface *s, QWaylandView *v) : surface(s) , views(1, v) - , has_entered(false) {} QWaylandView *maybePrimaryView() const @@ -90,9 +86,9 @@ struct QWaylandSurfaceViewMapper return nullptr; } - QWaylandSurface *surface; + QWaylandSurface *surface = nullptr; QVector views; - bool has_entered; + bool has_entered = false; }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandOutputPrivate : public QObjectPrivate, public QtWaylandServer::wl_output @@ -116,22 +112,22 @@ protected: void output_bind_resource(Resource *resource) override; private: - QWaylandCompositor *compositor; - QWindow *window; + QWaylandCompositor *compositor = nullptr; + QWindow *window = nullptr; QString manufacturer; QString model; QPoint position; QVector modes; - int currentMode; - int preferredMode; + int currentMode = -1; + int preferredMode = -1; QRect availableGeometry; QVector surfaceViews; QSize physicalSize; - QWaylandOutput::Subpixel subpixel; - QWaylandOutput::Transform transform; - int scaleFactor; - bool sizeFollowsWindow; - bool initialized; + QWaylandOutput::Subpixel subpixel = QWaylandOutput::SubpixelUnknown; + QWaylandOutput::Transform transform = QWaylandOutput::TransformNormal; + int scaleFactor = 1; + bool sizeFollowsWindow = false; + bool initialized = false; Q_DECLARE_PUBLIC(QWaylandOutput) Q_DISABLE_COPY(QWaylandOutputPrivate) diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp index 4bdee9be2..77e736a58 100644 --- a/src/compositor/compositor_api/qwaylandpointer.cpp +++ b/src/compositor/compositor_api/qwaylandpointer.cpp @@ -47,12 +47,7 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandPointerPrivate::s_role("wl_pointer"); QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandSeat *seat) - : QObjectPrivate() - , wl_pointer() - , seat(seat) - , output() - , enterSerial(0) - , buttonCount() + : seat(seat) { Q_UNUSED(pointer); } diff --git a/src/compositor/compositor_api/qwaylandpointer_p.h b/src/compositor/compositor_api/qwaylandpointer_p.h index 11076f34b..94f44f604 100644 --- a/src/compositor/compositor_api/qwaylandpointer_p.h +++ b/src/compositor/compositor_api/qwaylandpointer_p.h @@ -92,17 +92,17 @@ private: void sendLeave(); void ensureEntered(QWaylandSurface *surface); - QWaylandSeat *seat; - QWaylandOutput *output; + QWaylandSeat *seat = nullptr; + QWaylandOutput *output = nullptr; QPointer enteredSurface; QPointF localPosition; QPointF spacePosition; - bool hasSentEnter; - uint enterSerial; + bool hasSentEnter = false; + uint enterSerial = 0; - int buttonCount; + int buttonCount = 0; QWaylandDestroyListener enteredSurfaceDestroyListener; diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 91e85b884..23b52e0b4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -140,8 +140,7 @@ static const struct { }; QWaylandBufferMaterialShader::QWaylandBufferMaterialShader(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterialShader() - , m_format(format) + : m_format(format) { setShaderSourceFile(QOpenGLShader::Vertex, QString::fromLatin1(bufferTypes[format].vertexShaderSourceFile)); setShaderSourceFile(QOpenGLShader::Fragment, QString::fromLatin1(bufferTypes[format].fragmentShaderSourceFile)); @@ -183,8 +182,7 @@ void QWaylandBufferMaterialShader::initialize() } QWaylandBufferMaterial::QWaylandBufferMaterial(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterial() - , m_format(format) + : m_format(format) { QOpenGLFunctions *gl = QOpenGLContext::currentContext()->functions(); @@ -267,8 +265,6 @@ class QWaylandSurfaceTextureProvider : public QSGTextureProvider { public: QWaylandSurfaceTextureProvider() - : m_smooth(false) - , m_sgTex(nullptr) { } @@ -313,8 +309,8 @@ public: void setSmooth(bool smooth) { m_smooth = smooth; } private: - bool m_smooth; - QSGTexture *m_sgTex; + bool m_smooth = false; + QSGTexture *m_sgTex = nullptr; QWaylandBufferRef m_ref; }; diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h index 400cda742..de405a943 100644 --- a/src/compositor/compositor_api/qwaylandquickitem_p.h +++ b/src/compositor/compositor_api/qwaylandquickitem_p.h @@ -107,22 +107,7 @@ class QWaylandQuickItemPrivate : public QQuickItemPrivate { Q_DECLARE_PUBLIC(QWaylandQuickItem) public: - QWaylandQuickItemPrivate() - : QQuickItemPrivate() - , view(nullptr) - , oldSurface(nullptr) - , provider(nullptr) - , paintEnabled(true) - , touchEventsEnabled(true) - , inputEventsEnabled(true) - , isDragging(false) - , newTexture(false) - , focusOnClick(true) - , sizeFollowsSurface(true) - , connectedWindow(nullptr) - , origin(QWaylandSurface::OriginTopLeft) - { - } + QWaylandQuickItemPrivate() = default; void init() { @@ -169,20 +154,20 @@ public: static QMutex *mutex; QScopedPointer view; - QWaylandSurface *oldSurface; - mutable QWaylandSurfaceTextureProvider *provider; - bool paintEnabled; - bool touchEventsEnabled; - bool inputEventsEnabled; - bool isDragging; - bool newTexture; - bool focusOnClick; - bool sizeFollowsSurface; + QWaylandSurface *oldSurface = nullptr; + mutable QWaylandSurfaceTextureProvider *provider = nullptr; + bool paintEnabled = true; + bool touchEventsEnabled = true; + bool inputEventsEnabled = true; + bool isDragging = false; + bool newTexture = false; + bool focusOnClick = true; + bool sizeFollowsSurface = true; QPoint hoverPos; QMatrix4x4 lastMatrix; - QQuickWindow *connectedWindow; - QWaylandSurface::Origin origin; + QQuickWindow *connectedWindow = nullptr; + QWaylandSurface::Origin origin = QWaylandSurface::OriginTopLeft; QPointer subsurfaceHandler; QVector touchingSeats; }; diff --git a/src/compositor/compositor_api/qwaylandquickoutput.cpp b/src/compositor/compositor_api/qwaylandquickoutput.cpp index db7cc50bb..79e4fdec7 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.cpp +++ b/src/compositor/compositor_api/qwaylandquickoutput.cpp @@ -45,16 +45,11 @@ QT_BEGIN_NAMESPACE QWaylandQuickOutput::QWaylandQuickOutput() - : QWaylandOutput() - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } QWaylandQuickOutput::QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window) : QWaylandOutput(compositor, window) - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } diff --git a/src/compositor/compositor_api/qwaylandquickoutput.h b/src/compositor/compositor_api/qwaylandquickoutput.h index f023872c0..cd79f14f5 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.h +++ b/src/compositor/compositor_api/qwaylandquickoutput.h @@ -79,8 +79,8 @@ protected: private: void doFrameCallbacks(); - bool m_updateScheduled; - bool m_automaticFrameCallback; + bool m_updateScheduled = false; + bool m_automaticFrameCallback = true; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandquicksurface.cpp b/src/compositor/compositor_api/qwaylandquicksurface.cpp index 1197e9e43..a1269b117 100644 --- a/src/compositor/compositor_api/qwaylandquicksurface.cpp +++ b/src/compositor/compositor_api/qwaylandquicksurface.cpp @@ -56,9 +56,6 @@ class QWaylandQuickSurfacePrivate : public QWaylandSurfacePrivate Q_DECLARE_PUBLIC(QWaylandQuickSurface) public: QWaylandQuickSurfacePrivate() - : QWaylandSurfacePrivate() - , useTextureAlpha(true) - , clientRenderingEnabled(true) { } @@ -66,8 +63,8 @@ public: { } - bool useTextureAlpha; - bool clientRenderingEnabled; + bool useTextureAlpha = true; + bool clientRenderingEnabled = true; }; QWaylandQuickSurface::QWaylandQuickSurface() diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp index 7cfcce132..f3d010830 100644 --- a/src/compositor/compositor_api/qwaylandresource.cpp +++ b/src/compositor/compositor_api/qwaylandresource.cpp @@ -42,7 +42,6 @@ QT_BEGIN_NAMESPACE QWaylandResource::QWaylandResource() - : m_resource(nullptr) { } diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h index f8c50c082..11ab64da9 100644 --- a/src/compositor/compositor_api/qwaylandresource.h +++ b/src/compositor/compositor_api/qwaylandresource.h @@ -57,7 +57,7 @@ public: wl_resource *resource() const { return m_resource; } private: - wl_resource *m_resource; + wl_resource *m_resource = nullptr; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 2ee32bfb2..c67e6020d 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -60,21 +60,11 @@ QT_BEGIN_NAMESPACE -QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) - : QObjectPrivate() - , QtWaylandServer::wl_seat() - , isInitialized(false) - , compositor(nullptr) - , mouseFocus(nullptr) - , keyboardFocus(nullptr) - , capabilities() +QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) : #if QT_CONFIG(wayland_datadevice) - , data_device() + drag_handle(new QWaylandDrag(seat)), #endif -#if QT_CONFIG(draganddrop) - , drag_handle(new QWaylandDrag(seat)) -#endif - , keymap(new QWaylandKeymap()) + keymap(new QWaylandKeymap()) { } diff --git a/src/compositor/compositor_api/qwaylandseat_p.h b/src/compositor/compositor_api/qwaylandseat_p.h index 28a5fd4f0..1e182f41a 100644 --- a/src/compositor/compositor_api/qwaylandseat_p.h +++ b/src/compositor/compositor_api/qwaylandseat_p.h @@ -114,10 +114,10 @@ protected: void seat_destroy_resource(wl_seat::Resource *resource) override; private: - bool isInitialized; - QWaylandCompositor *compositor; - QWaylandView *mouseFocus; - QWaylandSurface *keyboardFocus; + bool isInitialized = false; + QWaylandCompositor *compositor = nullptr; + QWaylandView *mouseFocus = nullptr; + QWaylandSurface *keyboardFocus = nullptr; QWaylandSeat::CapabilityFlags capabilities; QScopedPointer pointer; diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index a5316f535..ed9bef3cf 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -75,7 +75,6 @@ public: FrameCallback(QWaylandSurface *surf, wl_resource *res) : surface(surf) , resource(res) - , canSend(false) { #if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) res->data = this; @@ -112,7 +111,7 @@ public: } QWaylandSurface *surface; wl_resource *resource; - bool canSend; + bool canSend = false; }; } static QRegion infiniteRegion() { @@ -125,22 +124,7 @@ QList QWaylandSurfacePrivate::uninitializedSurfaces; #endif QWaylandSurfacePrivate::QWaylandSurfacePrivate() - : QtWaylandServer::wl_surface() - , compositor(nullptr) - , refCount(1) - , client(nullptr) - , role(nullptr) - , inputRegion(infiniteRegion()) - , bufferScale(1) - , isCursorSurface(false) - , destroyed(false) - , hasContent(false) - , isInitialized(false) - , contentOrientation(Qt::PrimaryOrientation) -#if QT_CONFIG(im) - , inputMethodControl(nullptr) -#endif - , subsurface(nullptr) + : inputRegion(infiniteRegion()) { pending.buffer = QWaylandBufferRef(); pending.newlyAttached = false; diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 3c43fc043..3dc9bf20e 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -140,13 +140,13 @@ protected: QtWayland::ClientBuffer *getBuffer(struct ::wl_resource *buffer); public: //member variables - QWaylandCompositor *compositor; - int refCount; - QWaylandClient *client; + QWaylandCompositor *compositor = nullptr; + int refCount = 1; + QWaylandClient *client = nullptr; QList views; QRegion damage; QWaylandBufferRef bufferRef; - QWaylandSurfaceRole *role; + QWaylandSurfaceRole *role = nullptr; struct { QWaylandBufferRef buffer; @@ -167,15 +167,15 @@ public: //member variables QRegion opaqueRegion; QSize size; - int bufferScale; - bool isCursorSurface; - bool destroyed; - bool hasContent; - bool isInitialized; - Qt::ScreenOrientation contentOrientation; + int bufferScale = 1; + bool isCursorSurface = false; + bool destroyed = false; + bool hasContent = false; + bool isInitialized = false; + Qt::ScreenOrientation contentOrientation = Qt::PrimaryOrientation; QWindow::Visibility visibility; #if QT_CONFIG(im) - QWaylandInputMethodControl *inputMethodControl; + QWaylandInputMethodControl *inputMethodControl = nullptr; #endif class Subsurface : public QtWaylandServer::wl_subsurface @@ -198,7 +198,7 @@ public: //member variables QPoint position; }; - Subsurface *subsurface; + Subsurface *subsurface = nullptr; #ifndef QT_NO_DEBUG static QList uninitializedSurfaces; diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 396a3b689..3e7298001 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -50,8 +50,7 @@ QT_BEGIN_NAMESPACE QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandSeat *seat) - : wl_touch() - , seat(seat) + : seat(seat) { Q_UNUSED(touch); } diff --git a/src/compositor/compositor_api/qwaylandview_p.h b/src/compositor/compositor_api/qwaylandview_p.h index 1cc55954c..b9cb0d07b 100644 --- a/src/compositor/compositor_api/qwaylandview_p.h +++ b/src/compositor/compositor_api/qwaylandview_p.h @@ -71,32 +71,24 @@ public: static QWaylandViewPrivate *get(QWaylandView *view) { return view->d_func(); } QWaylandViewPrivate() - : renderObject(nullptr) - , surface(nullptr) - , output(nullptr) - , nextBufferCommitted(false) - , bufferLocked(false) - , broadcastRequestedPositionChanged(false) - , forceAdvanceSucceed(false) - , allowDiscardFrontBuffer(false) { } void markSurfaceAsDestroyed(QWaylandSurface *surface); - QObject *renderObject; - QWaylandSurface *surface; - QWaylandOutput *output; + QObject *renderObject = nullptr; + QWaylandSurface *surface = nullptr; + QWaylandOutput *output = nullptr; QPointF requestedPos; QMutex bufferMutex; QWaylandBufferRef currentBuffer; QRegion currentDamage; QWaylandBufferRef nextBuffer; QRegion nextDamage; - bool nextBufferCommitted; - bool bufferLocked; - bool broadcastRequestedPositionChanged; - bool forceAdvanceSucceed; - bool allowDiscardFrontBuffer; + bool nextBufferCommitted = false; + bool bufferLocked = false; + bool broadcastRequestedPositionChanged = false; + bool forceAdvanceSucceed = false; + bool allowDiscardFrontBuffer = false; bool independentFrameCallback = false; //If frame callbacks are independent of the main quick scene graph }; diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index 8295d2a18..57b1627b5 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -168,8 +168,6 @@ QByteArray QWaylandIviApplication::interfaceName() */ QWaylandIviApplicationPrivate::QWaylandIviApplicationPrivate() - : QWaylandCompositorExtensionPrivate() - , ivi_application() { } diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index 2bdd4a14d..716cc868f 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -218,11 +218,6 @@ void QWaylandIviSurface::initialize() } QWaylandIviSurfacePrivate::QWaylandIviSurfacePrivate() - : QWaylandCompositorExtensionPrivate() - , ivi_surface() - , m_iviApplication(nullptr) - , m_surface(nullptr) - , m_iviId(UINT_MAX) { } diff --git a/src/compositor/extensions/qwaylandivisurface_p.h b/src/compositor/extensions/qwaylandivisurface_p.h index 3edd0b1e8..0ead0647b 100644 --- a/src/compositor/extensions/qwaylandivisurface_p.h +++ b/src/compositor/extensions/qwaylandivisurface_p.h @@ -75,9 +75,9 @@ protected: void ivi_surface_destroy(Resource *resource) override; private: - QWaylandIviApplication *m_iviApplication; - QWaylandSurface *m_surface; - uint m_iviId; + QWaylandIviApplication *m_iviApplication = nullptr; + QWaylandSurface *m_surface = nullptr; + uint m_iviId = UINT_MAX; static QWaylandSurfaceRole s_role; }; diff --git a/src/compositor/extensions/qwaylandqtwindowmanager.cpp b/src/compositor/extensions/qwaylandqtwindowmanager.cpp index 4943681c6..86678b2e6 100644 --- a/src/compositor/extensions/qwaylandqtwindowmanager.cpp +++ b/src/compositor/extensions/qwaylandqtwindowmanager.cpp @@ -50,9 +50,6 @@ QT_BEGIN_NAMESPACE QWaylandQtWindowManagerPrivate::QWaylandQtWindowManagerPrivate() - : QWaylandCompositorExtensionPrivate() - , qt_windowmanager() - , showIsFullScreen(false) { } diff --git a/src/compositor/extensions/qwaylandqtwindowmanager_p.h b/src/compositor/extensions/qwaylandqtwindowmanager_p.h index 0856b3971..91e8e26cd 100644 --- a/src/compositor/extensions/qwaylandqtwindowmanager_p.h +++ b/src/compositor/extensions/qwaylandqtwindowmanager_p.h @@ -74,7 +74,7 @@ protected: void windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &url) override; private: - bool showIsFullScreen; + bool showIsFullScreen = false; QMap urls; }; diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp index 2b603099b..6b8845797 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp @@ -213,7 +213,7 @@ void QWaylandQuickShellEventFilter::stopFilter() QWaylandQuickShellEventFilter *QWaylandQuickShellEventFilter::self = nullptr; QWaylandQuickShellEventFilter::QWaylandQuickShellEventFilter(QObject *parent) - : QObject(parent), eventFilterInstalled(false), waitForRelease(false), closePopups(nullptr) + : QObject(parent) { } diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h index 9549cb0e3..abb56221e 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem_p.h @@ -65,14 +65,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItemPrivate : public { public: QWaylandQuickShellSurfaceItemPrivate() - : QWaylandQuickItemPrivate() - , m_shellIntegration(nullptr) - , m_shellSurface(nullptr) - , m_moveItem(nullptr) {} - QWaylandQuickShellIntegration *m_shellIntegration; - QWaylandShellSurface *m_shellSurface; - QQuickItem *m_moveItem; + QWaylandQuickShellIntegration *m_shellIntegration = nullptr; + QWaylandShellSurface *m_shellSurface = nullptr; + QQuickItem *m_moveItem = nullptr; }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellIntegration : public QObject @@ -100,10 +96,10 @@ private: QWaylandQuickShellEventFilter(QObject *parent = nullptr); bool eventFilter(QObject *, QEvent *) override; - bool eventFilterInstalled; - bool waitForRelease; + bool eventFilterInstalled = false; + bool waitForRelease = false; QPointer client; - CallbackFunction closePopups; + CallbackFunction closePopups = nullptr; QBasicTimer mousePressTimeout; static QWaylandQuickShellEventFilter *self; }; diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index adb5827d4..12479186b 100644 --- a/src/compositor/extensions/qwaylandshell.cpp +++ b/src/compositor/extensions/qwaylandshell.cpp @@ -43,12 +43,10 @@ QT_BEGIN_NAMESPACE QWaylandShellPrivate::QWaylandShellPrivate() - : focusPolicy(QWaylandShell::AutomaticFocus) { } QWaylandShell::QWaylandShell() - : QWaylandCompositorExtension() { } diff --git a/src/compositor/extensions/qwaylandshell_p.h b/src/compositor/extensions/qwaylandshell_p.h index 968bf5bd7..f333b9b4c 100644 --- a/src/compositor/extensions/qwaylandshell_p.h +++ b/src/compositor/extensions/qwaylandshell_p.h @@ -62,7 +62,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellPrivate : public QWaylandComposit public: QWaylandShellPrivate(); - QWaylandShell::FocusPolicy focusPolicy; + QWaylandShell::FocusPolicy focusPolicy = QWaylandShell::AutomaticFocus; }; QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp index 552aa0667..b832bb737 100644 --- a/src/compositor/extensions/qwaylandtextinput.cpp +++ b/src/compositor/extensions/qwaylandtextinput.cpp @@ -54,13 +54,6 @@ QT_BEGIN_NAMESPACE QWaylandTextInputClientState::QWaylandTextInputClientState() - : hints(Qt::ImhNone) - , cursorRectangle() - , surroundingText() - , cursorPosition(0) - , anchorPosition(0) - , preferredLanguage() - , changedState() { } @@ -121,17 +114,9 @@ Qt::InputMethodQueries QWaylandTextInputClientState::mergeChanged(const QWayland } QWaylandTextInputPrivate::QWaylandTextInputPrivate(QWaylandCompositor *compositor) - : QWaylandCompositorExtensionPrivate() - , QtWaylandServer::zwp_text_input_v2() - , compositor(compositor) - , focus(nullptr) - , focusResource(nullptr) - , focusDestroyListener() - , inputPanelVisible(false) + : compositor(compositor) , currentState(new QWaylandTextInputClientState) , pendingState(new QWaylandTextInputClientState) - , serial(0) - , enabledSurfaces() { } diff --git a/src/compositor/extensions/qwaylandtextinput_p.h b/src/compositor/extensions/qwaylandtextinput_p.h index e96b0c01e..976c96198 100644 --- a/src/compositor/extensions/qwaylandtextinput_p.h +++ b/src/compositor/extensions/qwaylandtextinput_p.h @@ -76,11 +76,11 @@ public: Qt::InputMethodQueries updatedQueries(const QWaylandTextInputClientState &other) const; Qt::InputMethodQueries mergeChanged(const QWaylandTextInputClientState &other); - Qt::InputMethodHints hints; + Qt::InputMethodHints hints = Qt::ImhNone; QRect cursorRectangle; QString surroundingText; - int cursorPosition; - int anchorPosition; + int cursorPosition = 0; + int anchorPosition = 0; QString preferredLanguage; Qt::InputMethodQueries changedState; @@ -102,18 +102,18 @@ public: void setFocus(QWaylandSurface *surface); - QWaylandCompositor *compositor; + QWaylandCompositor *compositor = nullptr; - QWaylandSurface *focus; - Resource *focusResource; + QWaylandSurface *focus = nullptr; + Resource *focusResource = nullptr; QWaylandDestroyListener focusDestroyListener; - bool inputPanelVisible; + bool inputPanelVisible = false; QScopedPointer currentState; QScopedPointer pendingState; - uint32_t serial; + uint32_t serial = 0; QHash enabledSurfaces; diff --git a/src/compositor/extensions/qwaylandtextinputmanager.cpp b/src/compositor/extensions/qwaylandtextinputmanager.cpp index 0fda80990..f18ca5d51 100644 --- a/src/compositor/extensions/qwaylandtextinputmanager.cpp +++ b/src/compositor/extensions/qwaylandtextinputmanager.cpp @@ -48,8 +48,6 @@ QT_BEGIN_NAMESPACE QWaylandTextInputManagerPrivate::QWaylandTextInputManagerPrivate() - : QWaylandCompositorExtensionPrivate() - , QtWaylandServer::zwp_text_input_manager_v2() { } diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 59b311919..c3d15c6aa 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandWlShellSurfacePrivate::s_role("wl_shell_surface"); QWaylandWlShellPrivate::QWaylandWlShellPrivate() - : QWaylandCompositorExtensionPrivate() - , wl_shell() { } @@ -102,11 +100,6 @@ void QWaylandWlShellPrivate::unregisterShellSurface(QWaylandWlShellSurface *shel } QWaylandWlShellSurfacePrivate::QWaylandWlShellSurfacePrivate() - : QWaylandCompositorExtensionPrivate() - , wl_shell_surface() - , m_shell(nullptr) - , m_surface(nullptr) - , m_windowType(Qt::WindowType::Window) { } diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index 994b4dcbf..4e91eabc9 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -100,14 +100,14 @@ public: void setWindowType(Qt::WindowType windowType); private: - QWaylandWlShell *m_shell; + QWaylandWlShell *m_shell = nullptr; QPointer m_surface; QSet m_pings; QString m_title; QString m_className; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; void shell_surface_destroy_resource(Resource *resource) override; diff --git a/src/compositor/extensions/qwaylandwlshellintegration.cpp b/src/compositor/extensions/qwaylandwlshellintegration.cpp index 7e3d31f18..9e1e9dd6d 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration.cpp +++ b/src/compositor/extensions/qwaylandwlshellintegration.cpp @@ -52,10 +52,6 @@ WlShellIntegration::WlShellIntegration(QWaylandQuickShellSurfaceItem *item) : QWaylandQuickShellIntegration(item) , m_item(item) , m_shellSurface(qobject_cast(item->shellSurface())) - , grabberState(GrabberState::Default) - , isPopup(false) - , currentState(State::Windowed) - , nextState(State::Windowed) { m_item->setSurface(m_shellSurface->surface()); connect(m_shellSurface.data(), &QWaylandWlShellSurface::startMove, this, &WlShellIntegration::handleStartMove); diff --git a/src/compositor/extensions/qwaylandwlshellintegration_p.h b/src/compositor/extensions/qwaylandwlshellintegration_p.h index 9a2e5a3a2..7b9569122 100644 --- a/src/compositor/extensions/qwaylandwlshellintegration_p.h +++ b/src/compositor/extensions/qwaylandwlshellintegration_p.h @@ -94,7 +94,7 @@ private: QWaylandQuickShellSurfaceItem *m_item; QPointer m_shellSurface; - GrabberState grabberState; + GrabberState grabberState = GrabberState::Default; struct { QWaylandSeat *seat; QPointF initialOffset; @@ -108,7 +108,7 @@ private: bool initialized; } resizeState; - bool isPopup; + bool isPopup = false; enum class State { Windowed, @@ -116,8 +116,8 @@ private: FullScreen }; - State currentState; - State nextState; + State currentState = State::Windowed; + State nextState = State::Windowed; QPointF normalPosition; QPointF finalPosition; }; diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index b5db226c2..13a95e17d 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -60,8 +60,6 @@ QWaylandSurfaceRole QWaylandXdgSurfaceV5Private::s_role("xdg_surface"); QWaylandSurfaceRole QWaylandXdgPopupV5Private::s_role("xdg_popup"); QWaylandXdgShellV5Private::QWaylandXdgShellV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_shell() { } @@ -223,14 +221,7 @@ void QWaylandXdgShellV5Private::xdg_shell_pong(Resource *resource, uint32_t seri } QWaylandXdgSurfaceV5Private::QWaylandXdgSurfaceV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_surface() - , m_xdgShell(nullptr) - , m_surface(nullptr) - , m_parentSurface(nullptr) - , m_windowType(Qt::WindowType::Window) - , m_unsetWindowGeometry(true) - , m_lastAckedConfigure({{}, QSize(0, 0), 0}) + : m_lastAckedConfigure({{}, QSize(0, 0), 0}) { } @@ -490,11 +481,6 @@ void QWaylandXdgSurfaceV5Private::xdg_surface_set_window_geometry(Resource *reso } QWaylandXdgPopupV5Private::QWaylandXdgPopupV5Private() - : QWaylandCompositorExtensionPrivate() - , xdg_popup() - , m_surface(nullptr) - , m_parentSurface(nullptr) - , m_xdgShell(nullptr) { } diff --git a/src/compositor/extensions/qwaylandxdgshellv5_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h index 9b14f525d..b0b51698d 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h @@ -116,16 +116,16 @@ public: void setWindowType(Qt::WindowType windowType); private: - QWaylandXdgShellV5 *m_xdgShell; - QWaylandSurface *m_surface; - QWaylandXdgSurfaceV5 *m_parentSurface; + QWaylandXdgShellV5 *m_xdgShell = nullptr; + QWaylandSurface *m_surface = nullptr; + QWaylandXdgSurfaceV5 *m_parentSurface = nullptr; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; QString m_title; QString m_appId; QRect m_windowGeometry; - bool m_unsetWindowGeometry; + bool m_unsetWindowGeometry = true; QList m_pendingConfigures; ConfigureEvent m_lastAckedConfigure; @@ -166,9 +166,9 @@ public: QWaylandXdgPopupV5Private(); static QWaylandXdgPopupV5Private *get(QWaylandXdgPopupV5 *xdgPopup) { return xdgPopup->d_func(); } - QWaylandSurface *m_surface; - QWaylandSurface *m_parentSurface; - QWaylandXdgShellV5 *m_xdgShell; + QWaylandSurface *m_surface = nullptr; + QWaylandSurface *m_parentSurface = nullptr; + QWaylandXdgShellV5 *m_xdgShell = nullptr; QPoint m_position; void xdg_popup_destroy_resource(Resource *resource) override; diff --git a/src/compositor/extensions/qwaylandxdgshellv6.cpp b/src/compositor/extensions/qwaylandxdgshellv6.cpp index 4b1d46b8a..3485f80a4 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv6.cpp @@ -54,8 +54,6 @@ QT_BEGIN_NAMESPACE QWaylandXdgShellV6Private::QWaylandXdgShellV6Private() - : QWaylandCompositorExtensionPrivate() - , zxdg_shell_v6() { } @@ -288,14 +286,6 @@ void QWaylandXdgShellV6::handleFocusChanged(QWaylandSurface *newSurface, QWaylan } QWaylandXdgSurfaceV6Private::QWaylandXdgSurfaceV6Private() - : QWaylandCompositorExtensionPrivate() - , zxdg_surface_v6() - , m_xdgShell(nullptr) - , m_surface(nullptr) - , m_toplevel(nullptr) - , m_popup(nullptr) - , m_unsetWindowGeometry(true) - , m_windowType(Qt::WindowType::Window) { } @@ -1097,8 +1087,6 @@ QWaylandSurfaceRole QWaylandXdgToplevelV6Private::s_role("zxdg_toplevel_v6"); QWaylandXdgToplevelV6Private::QWaylandXdgToplevelV6Private(QWaylandXdgSurfaceV6 *xdgSurface, const QWaylandResource &resource) : m_xdgSurface(xdgSurface) - , m_parentToplevel(nullptr) - , m_lastAckedConfigure({{}, QSize(0, 0), 0}) { init(resource.resource()); } @@ -1756,10 +1744,7 @@ void QWaylandXdgPopupV6Private::zxdg_popup_v6_grab(QtWaylandServer::zxdg_popup_v QWaylandSurfaceRole QWaylandXdgPopupV6Private::s_role("zxdg_popup_v6"); QWaylandXdgPositionerV6Data::QWaylandXdgPositionerV6Data() - : anchorEdges(0) - , gravityEdges(0) - , constraintAdjustments(ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE) - , offset(0, 0) + : offset(0, 0) {} bool QWaylandXdgPositionerV6Data::isComplete() const diff --git a/src/compositor/extensions/qwaylandxdgshellv6_p.h b/src/compositor/extensions/qwaylandxdgshellv6_p.h index 98bcb70f7..191a936f9 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv6_p.h @@ -60,9 +60,9 @@ QT_BEGIN_NAMESPACE struct Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPositionerV6Data { QSize size; QRect anchorRect; - Qt::Edges anchorEdges; - Qt::Edges gravityEdges; - uint constraintAdjustments; + Qt::Edges anchorEdges = 0; + Qt::Edges gravityEdges = 0; + uint constraintAdjustments = ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE; QPoint offset; QWaylandXdgPositionerV6Data(); bool isComplete() const; @@ -112,15 +112,15 @@ public: void updateFallbackWindowGeometry(); private: - QWaylandXdgShellV6 *m_xdgShell; - QWaylandSurface *m_surface; + QWaylandXdgShellV6 *m_xdgShell = nullptr; + QWaylandSurface *m_surface = nullptr; - QWaylandXdgToplevelV6 *m_toplevel; - QWaylandXdgPopupV6 *m_popup; + QWaylandXdgToplevelV6 *m_toplevel = nullptr; + QWaylandXdgPopupV6 *m_popup = nullptr; QRect m_windowGeometry; - bool m_unsetWindowGeometry; + bool m_unsetWindowGeometry = true; QMargins m_windowMargins; - Qt::WindowType m_windowType; + Qt::WindowType m_windowType = Qt::WindowType::Window; void zxdg_surface_v6_destroy_resource(Resource *resource) override; void zxdg_surface_v6_destroy(Resource *resource) override; @@ -136,8 +136,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgToplevelV6Private : public QObjectP public: struct ConfigureEvent { QVector states; - QSize size; - uint serial; + QSize size = {0, 0}; + uint serial = 0; }; QWaylandXdgToplevelV6Private(QWaylandXdgSurfaceV6 *xdgSurface, const QWaylandResource& resource); @@ -169,7 +169,7 @@ protected: public: QWaylandXdgSurfaceV6 *m_xdgSurface; - QWaylandXdgToplevelV6 *m_parentToplevel; + QWaylandXdgToplevelV6 *m_parentToplevel = nullptr; QList m_pendingConfigures; ConfigureEvent m_lastAckedConfigure; QString m_title; diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp index 161ec6c18..6d1be4a35 100644 --- a/src/compositor/extensions/qwlqttouch.cpp +++ b/src/compositor/extensions/qwlqttouch.cpp @@ -52,8 +52,6 @@ TouchExtensionGlobal::TouchExtensionGlobal(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) , QtWaylandServer::qt_touch_extension(compositor->display(), 1) , m_compositor(compositor) - , m_flags(BehaviorFlag::None) - , m_resources() , m_posData(maxRawPos * 2) { } diff --git a/src/compositor/extensions/qwlqttouch_p.h b/src/compositor/extensions/qwlqttouch_p.h index e605c89e1..3f046a576 100644 --- a/src/compositor/extensions/qwlqttouch_p.h +++ b/src/compositor/extensions/qwlqttouch_p.h @@ -94,7 +94,7 @@ protected: private: QWaylandCompositor *m_compositor; - BehaviorFlags m_flags; + BehaviorFlags m_flags = BehaviorFlag::None; QList m_resources; QVector m_posData; }; diff --git a/src/compositor/global/qwaylandcompositorextension_p.h b/src/compositor/global/qwaylandcompositorextension_p.h index 68f817aa6..6ec810988 100644 --- a/src/compositor/global/qwaylandcompositorextension_p.h +++ b/src/compositor/global/qwaylandcompositorextension_p.h @@ -63,16 +63,13 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandCompositorExtensionPrivate : public QO public: QWaylandCompositorExtensionPrivate() - : QObjectPrivate() - , extension_container(nullptr) - , initialized(false) { } static QWaylandCompositorExtensionPrivate *get(QWaylandCompositorExtension *extension) { return extension->d_func(); } - QWaylandObject *extension_container; - bool initialized; + QWaylandObject *extension_container = nullptr; + bool initialized = false; }; QT_END_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp index 3f4d4a412..7407aca58 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp @@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE namespace QtWayland { ClientBufferIntegration::ClientBufferIntegration() - : m_compositor(nullptr) { } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index 1b54786f2..13a69fce9 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -79,7 +79,7 @@ public: virtual ClientBuffer *createBufferFor(struct ::wl_resource *buffer) = 0; protected: - QWaylandCompositor *m_compositor; + QWaylandCompositor *m_compositor = nullptr; }; } diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp index 86331a744..d5c661e93 100644 --- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp +++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp @@ -57,13 +57,12 @@ BufferManager::BufferManager(QWaylandCompositor *compositor) struct buffer_manager_destroy_listener : wl_listener { buffer_manager_destroy_listener() - : d(nullptr) { notify = BufferManager::destroy_listener_callback; wl_list_init(&this->link); } - BufferManager *d; + BufferManager *d = nullptr; }; ClientBuffer *BufferManager::getBuffer(wl_resource *buffer_resource) diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 7d7e787c4..7df9ead3c 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -58,9 +58,6 @@ namespace QtWayland { ClientBuffer::ClientBuffer(struct ::wl_resource *buffer) : m_buffer(buffer) - , m_textureDirty(false) - , m_committed(false) - , m_destroyed(false) { } @@ -117,9 +114,6 @@ QWaylandBufferRef::BufferFormatEgl ClientBuffer::bufferFormatEgl() const SharedMemoryBuffer::SharedMemoryBuffer(wl_resource *bufferResource) : ClientBuffer(bufferResource) -#if QT_CONFIG(opengl) - , m_shmTexture(nullptr) -#endif { } diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h index 5a66a67a7..5f3475ed7 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h @@ -114,11 +114,11 @@ protected: struct ::wl_resource *m_buffer; QRegion m_damage; - bool m_textureDirty; + bool m_textureDirty = false; private: - bool m_committed; - bool m_destroyed; + bool m_committed = false; + bool m_destroyed = false; QAtomicInt m_refCount; @@ -139,7 +139,7 @@ public: QOpenGLTexture *toOpenGlTexture(int plane = 0) override; private: - QOpenGLTexture *m_shmTexture; + QOpenGLTexture *m_shmTexture = nullptr; #endif }; diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 3b557a109..6dc1355d5 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -61,18 +61,8 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDevice::DataDevice(QWaylandSeat *seat) - : wl_data_device() - , m_compositor(seat->compositor()) + : m_compositor(seat->compositor()) , m_seat(seat) - , m_selectionSource(nullptr) -#if QT_CONFIG(draganddrop) - , m_dragClient(nullptr) - , m_dragDataSource(nullptr) - , m_dragFocus(nullptr) - , m_dragFocusResource(nullptr) - , m_dragIcon(nullptr) - , m_dragOrigin(nullptr) -#endif { } diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index d041f0158..4cb492509 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -99,17 +99,17 @@ private: QWaylandCompositor *m_compositor; QWaylandSeat *m_seat; - DataSource *m_selectionSource; + DataSource *m_selectionSource = nullptr; #if QT_CONFIG(draganddrop) - struct ::wl_client *m_dragClient; - DataSource *m_dragDataSource; + struct ::wl_client *m_dragClient = nullptr; + DataSource *m_dragDataSource = nullptr; - QWaylandSurface *m_dragFocus; - Resource *m_dragFocusResource; + QWaylandSurface *m_dragFocus = nullptr; + Resource *m_dragFocusResource = nullptr; - QWaylandSurface *m_dragIcon; - QWaylandSurface *m_dragOrigin; + QWaylandSurface *m_dragIcon = nullptr; + QWaylandSurface *m_dragOrigin = nullptr; #endif }; diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index 0c0855d24..acca08e07 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -59,12 +59,8 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor) - : QObject(nullptr) - , wl_data_device_manager(compositor->display(), 1) + : wl_data_device_manager(compositor->display(), 1) , m_compositor(compositor) - , m_current_selection_source(nullptr) - , m_retainedReadNotifier(nullptr) - , m_compositorOwnsSelection(false) { } diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index d6ace5c00..9c6672db6 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -104,15 +104,15 @@ private: QWaylandCompositor *m_compositor; QList m_data_device_list; - DataSource *m_current_selection_source; + DataSource *m_current_selection_source = nullptr; QMimeData m_retainedData; - QSocketNotifier *m_retainedReadNotifier; + QSocketNotifier *m_retainedReadNotifier = nullptr; QList m_obsoleteRetainedReadNotifiers; int m_retainedReadIndex; QByteArray m_retainedReadBuf; - bool m_compositorOwnsSelection; + bool m_compositorOwnsSelection = false; static void comp_accept(struct wl_client *client, diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 2d523dad9..baa47d6fc 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -52,8 +52,6 @@ namespace QtWayland { DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time) : QtWaylandServer::wl_data_source(client, id, 1) , m_time(time) - , m_device(nullptr) - , m_manager(nullptr) { } diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index cf54d762f..d5437a301 100644 --- a/src/compositor/wayland_wrapper/qwldatasource_p.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -92,8 +92,8 @@ private: uint32_t m_time; QList m_mimeTypes; - DataDevice *m_device; - DataDeviceManager *m_manager; + DataDevice *m_device = nullptr; + DataDeviceManager *m_manager = nullptr; }; } diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp index 430b455f4..4478b9fdf 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp @@ -53,7 +53,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration() - : m_waylandDisplay(0) { qDebug() << "Using Brcm-EGL"; } diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h index 0a913bcdf..8d89ebf74 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h @@ -85,7 +85,7 @@ public: private: static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); - struct wl_display *m_waylandDisplay; + struct wl_display *m_waylandDisplay = nullptr; struct qt_brcm *m_waylandBrcm; EGLDisplay m_eglDisplay; diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp index f2709983e..6b3c614a5 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp @@ -67,7 +67,6 @@ public: int count, struct wl_event_queue *eventQueue) : m_size(size) - , m_released(true) , m_display(display) , m_eventQueue(eventQueue) { @@ -119,7 +118,7 @@ public: private: QSize m_size; - bool m_released; + bool m_released = true; wl_array m_array; EGLint *m_data; QWaylandDisplay *m_display; @@ -129,11 +128,8 @@ private: QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window) : QWaylandWindow(window) , m_eglIntegration(static_cast(mDisplay->clientBufferIntegration())) - , m_eglConfig(0) , m_format(window->format()) , m_eventQueue(wl_display_create_queue(mDisplay->wl_display())) - , m_current(0) - , m_count(0) { } diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h index be88df9af..28376669d 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h @@ -77,7 +77,7 @@ private: const QWaylandWindow *m_parentWindow; - EGLConfig m_eglConfig; + EGLConfig m_eglConfig = 0; EGLint m_globalImages[3*5]; EGLSurface m_eglSurfaces[3]; @@ -87,8 +87,8 @@ private: struct wl_event_queue *m_eventQueue; - int m_current; - int m_count; + int m_current = 0; + int m_count = 0; }; } diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp index fe2adbf56..754196468 100644 --- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp @@ -55,8 +55,7 @@ DrmServerBuffer::DrmServerBuffer(DrmEglServerBufferIntegration *integration , int32_t height , int32_t stride , int32_t format) - : QWaylandServerBuffer() - , m_integration(integration) + : m_integration(integration) { m_size = QSize(width, height); EGLint egl_format; diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index 51b904e75..252ceb698 100644 --- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -60,7 +60,6 @@ LibHybrisServerBuffer::LibHybrisServerBuffer(LibHybrisEglServerBufferIntegration , int32_t format) : QWaylandServerBuffer() , m_integration(integration) - , m_texture(nullptr) , m_stride(stride) , m_hybrisFormat(format) { diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h index b3c9c464d..1ba38e6e4 100644 --- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h +++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h @@ -83,7 +83,7 @@ protected: private: LibHybrisEglServerBufferIntegration *m_integration; EGLImageKHR m_image; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; int m_numFds; QVector m_ints; QVector m_fds; diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp index bc597ebf8..0c43b089a 100644 --- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp +++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp @@ -89,9 +89,7 @@ static QOpenGLTexture *createTextureFromShm(const QString &key, int w, int h, in namespace QtWaylandClient { ShmServerBuffer::ShmServerBuffer(ShmServerBufferIntegration *integration, const QString &key, int32_t width, int32_t height, int32_t bytes_per_line, int32_t format) - : QWaylandServerBuffer() - , m_integration(integration) - , m_texture(nullptr) + : m_integration(integration) , m_key(key) , m_bpl(bytes_per_line) , m_format(format) diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h index ce4032ba4..788344ff6 100644 --- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h +++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h @@ -62,7 +62,7 @@ public: QOpenGLTexture* toOpenGlTexture() override; private: ShmServerBufferIntegration *m_integration; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QString m_key; int m_bpl; int m_format; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 8a1009fa8..4b3a635c7 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -64,9 +64,6 @@ static const char *qwaylandegl_threadedgl_blacklist_vendor[] = { }; QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration() - : m_display(0) - , m_eglDisplay(EGL_NO_DISPLAY) - , m_supportsThreading(false) { qDebug() << "Using Wayland-EGL"; } diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h index 427a30d8e..93edfcc58 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h @@ -72,10 +72,10 @@ public: EGLDisplay eglDisplay() const; private: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; - EGLDisplay m_eglDisplay; - bool m_supportsThreading; + EGLDisplay m_eglDisplay = EGL_NO_DISPLAY; + bool m_supportsThreading = false; }; QT_END_NAMESPACE diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 87f3e2d4e..870b71c1a 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -57,10 +57,6 @@ namespace QtWaylandClient { QWaylandEglWindow::QWaylandEglWindow(QWindow *window) : QWaylandWindow(window) , m_clientBufferIntegration(static_cast(mDisplay->clientBufferIntegration())) - , m_waylandEglWindow(0) - , m_eglSurface(0) - , m_contentFBO(0) - , m_resize(false) { QSurfaceFormat fmt = window->requestedFormat(); if (mDisplay->supportsWindowDecoration()) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 77aee56dc..94947365c 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -82,14 +82,14 @@ private Q_SLOTS: private: QWaylandEglClientBufferIntegration *m_clientBufferIntegration; - struct wl_egl_window *m_waylandEglWindow; + struct wl_egl_window *m_waylandEglWindow = nullptr; const QWaylandWindow *m_parentWindow; - EGLSurface m_eglSurface; + EGLSurface m_eglSurface = EGL_NO_SURFACE; EGLConfig m_eglConfig; - mutable QOpenGLFramebufferObject *m_contentFBO; - mutable bool m_resize; + mutable bool m_resize = false; + mutable QOpenGLFramebufferObject *m_contentFBO = nullptr; QSurfaceFormat m_format; }; diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 967028861..740ad6b10 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -229,9 +229,6 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis : QPlatformOpenGLContext() , m_eglDisplay(eglDisplay) , m_display(display) - , m_blitter(0) - , mUseNativeDefaultFbo(false) - , mSupportNonBlockingSwap(true) { QSurfaceFormat fmt = format; if (static_cast(QGuiApplicationPrivate::platformIntegration())->display()->supportsWindowDecoration()) diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h index 6d9887de6..af1c4e04d 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h @@ -89,10 +89,10 @@ private: EGLContext m_shareEGLContext; EGLConfig m_config; QSurfaceFormat m_format; - DecorationsBlitter *m_blitter; - bool mUseNativeDefaultFbo; + DecorationsBlitter *m_blitter = nullptr; + bool mUseNativeDefaultFbo = false; uint m_api; - bool mSupportNonBlockingSwap; + bool mSupportNonBlockingSwap = true; friend class DecorationsBlitter; }; diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp index 2a7de6b72..aa5367e02 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp @@ -54,8 +54,6 @@ namespace QtWaylandClient { QWaylandXCompositeEGLClientBufferIntegration::QWaylandXCompositeEGLClientBufferIntegration() : QWaylandClientBufferIntegration() - , mWaylandDisplay(0) - , mDisplay(0) { qDebug() << "Using XComposite-EGL"; } diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h index cdc071e55..3742e1f56 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h @@ -92,10 +92,10 @@ public: bool supportsWindowDecoration() const override { return false; } private: - QWaylandDisplay *mWaylandDisplay; + QWaylandDisplay *mWaylandDisplay = nullptr; struct qt_xcomposite *mWaylandComposite; - Display *mDisplay; + Display *mDisplay = nullptr; EGLDisplay mEglDisplay; int mScreen; Window mRootWindow; diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp index 9c3dee3fc..57a7ba7b6 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp @@ -57,10 +57,7 @@ namespace QtWaylandClient { QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) - , m_buffer(0) - , m_xWindow(0) , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->format(), true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT)) - , m_surface(0) { } diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h index 90b4cc73e..d90159fa7 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h @@ -66,11 +66,11 @@ private: void createEglSurface(); QWaylandXCompositeEGLClientBufferIntegration *m_glxIntegration; - QWaylandBuffer *m_buffer; + QWaylandBuffer *m_buffer = nullptr; - Window m_xWindow; + Window m_xWindow = 0; EGLConfig m_config; - EGLSurface m_surface; + EGLSurface m_surface = EGL_NO_SURFACE; }; } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp index dbd7761e3..090cfb8a0 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp @@ -52,11 +52,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration() - : mWaylandDisplay(0) - , mWaylandComposite(0) - , mDisplay(0) - , mScreen(0) - , mRootWindow(0) { qDebug() << "Using XComposite-GLX"; } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h index 288bf3111..746678f7a 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h @@ -86,12 +86,12 @@ public: bool supportsWindowDecoration() const override { return false; } private: - QWaylandDisplay *mWaylandDisplay; - struct qt_xcomposite *mWaylandComposite; + QWaylandDisplay *mWaylandDisplay = nullptr; + struct qt_xcomposite *mWaylandComposite = nullptr; - Display *mDisplay; - int mScreen; - Window mRootWindow; + Display *mDisplay = nullptr; + int mScreen = 0; + Window mRootWindow = 0; static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp index 9cca9e46e..2b491e24d 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp @@ -54,9 +54,7 @@ namespace QtWaylandClient { QWaylandXCompositeGLXWindow::QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) - , m_xWindow(0) , m_config(qglx_findConfig(glxIntegration->xDisplay(), glxIntegration->screen(), window->format(), GLX_WINDOW_BIT | GLX_PIXMAP_BIT)) - , mBuffer(0) { } diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h index aeb5c14ec..c2df592ee 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h @@ -69,9 +69,9 @@ private: QWaylandXCompositeGLXIntegration *m_glxIntegration; - Window m_xWindow; + Window m_xWindow = 0; GLXFBConfig m_config; - QWaylandBuffer *mBuffer; + QWaylandBuffer *mBuffer = nullptr; }; } diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp index 768545772..f5573fefd 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp +++ b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.cpp @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE BrcmBuffer::BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count) : QtWaylandServer::wl_buffer(client, id, 1) , m_handle(count) - , m_invertedY(false) , m_size(size) { for (size_t i = 0; i < count; ++i) diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h index 605adef7f..3028fbed5 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h +++ b/src/hardwareintegration/compositor/brcm-egl/brcmbuffer.h @@ -70,7 +70,7 @@ protected: private: QVector m_handle; - bool m_invertedY; + bool m_invertedY = false; QSize m_size; }; diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp index 312dfbcfa..852ec3dee 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp @@ -60,15 +60,12 @@ QT_BEGIN_NAMESPACE class BrcmEglIntegrationPrivate { public: - BrcmEglIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - { } + BrcmEglIntegrationPrivate() = default; static BrcmEglIntegrationPrivate *get(BrcmEglIntegration *integration); - EGLDisplay egl_display; - bool valid; + EGLDisplay egl_display = EGL_NO_DISPLAY; + bool valid = false; PFNEGLQUERYGLOBALIMAGEBRCMPROC eglQueryGlobalImageBRCM; PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; @@ -76,9 +73,7 @@ public: }; BrcmEglIntegration::BrcmEglIntegration() - : QtWayland::ClientBufferIntegration() - , QtWaylandServer::qt_brcm() - , d_ptr(new BrcmEglIntegrationPrivate) + : d_ptr(new BrcmEglIntegrationPrivate) { } @@ -188,7 +183,6 @@ void BrcmEglIntegration::brcm_create_buffer(Resource *resource, uint32_t id, int BrcmEglClientBuffer::BrcmEglClientBuffer(BrcmEglIntegration *integration, wl_resource *buffer) : ClientBuffer(buffer) , m_integration(integration) - , m_texture(nullptr) { } diff --git a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h index dea61b4bb..89e53bc30 100644 --- a/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h +++ b/src/hardwareintegration/compositor/brcm-egl/brcmeglintegration.h @@ -79,8 +79,8 @@ public: QWaylandSurface::Origin origin() const override; QOpenGLTexture *toOpenGlTexture(int plane) override; private: - BrcmEglIntegration *m_integration; - QOpenGLTexture *m_texture; + BrcmEglIntegration *m_integration = nullptr; + QOpenGLTexture *m_texture = nullptr; }; diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp index c7dbe1bea..ef14aa2a2 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp @@ -47,7 +47,6 @@ QT_BEGIN_NAMESPACE DrmEglServerBuffer::DrmEglServerBuffer(DrmEglServerBufferIntegration *integration, const QImage &qimage, QtWayland::ServerBuffer::Format format) : QtWayland::ServerBuffer(qimage.size(),format) , m_integration(integration) - , m_texture(nullptr) { m_format = format; diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h index e1cc8768f..b3bcc3109 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.h @@ -89,7 +89,7 @@ private: int32_t m_name; int32_t m_stride; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QtWaylandServer::qt_drm_egl_server_buffer::format m_drm_format; }; diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index de9e1cf6e..5a42c00dc 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -48,7 +48,6 @@ QT_BEGIN_NAMESPACE LibHybrisEglServerBuffer::LibHybrisEglServerBuffer(LibHybrisEglServerBufferIntegration *integration, const QImage &qimage, QtWayland::ServerBuffer::Format format) : QtWayland::ServerBuffer(qimage.size(),format) , m_integration(integration) - , m_texture(nullptr) { m_format = format; diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h index 0e1593447..f99dacd99 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.h @@ -91,7 +91,7 @@ private: int32_t m_name; int32_t m_stride; - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; QtWaylandServer::qt_libhybris_egl_server_buffer::format m_hybris_format; QVector m_ints; QVector m_fds; diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index a088027a3..6de664564 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -151,7 +151,7 @@ egl_error_string(EGLint code) struct BufferState { - BufferState(); + BufferState() = default; enum EglMode { ModeUninitialized, @@ -159,14 +159,14 @@ struct BufferState ModeEGLStream }; - EGLint egl_format; + EGLint egl_format = EGL_TEXTURE_RGBA; QVarLengthArray egl_images; QOpenGLTexture *textures[3] = {}; - EGLStreamKHR egl_stream; + EGLStreamKHR egl_stream = EGL_NO_STREAM_KHR; - bool isYInverted; + bool isYInverted = true; QSize size; - EglMode eglMode; + EglMode eglMode = ModeUninitialized; }; class WaylandEglClientBufferIntegrationPrivate @@ -181,22 +181,22 @@ public: void handleEglstreamTexture(WaylandEglClientBuffer *buffer, wl_resource *bufferHandle); void registerBuffer(struct ::wl_resource *buffer, BufferState state); - EGLDisplay egl_display; - bool valid; - bool display_bound; + EGLDisplay egl_display = EGL_NO_DISPLAY; + bool valid = false; + bool display_bound = false; QOffscreenSurface *offscreenSurface = nullptr; QOpenGLContext *localContext = nullptr; - PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display; - PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display; - PFNEGLQUERYWAYLANDBUFFERWL_compat egl_query_wayland_buffer; + PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display = nullptr; + PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display = nullptr; + PFNEGLQUERYWAYLANDBUFFERWL_compat egl_query_wayland_buffer = nullptr; - PFNEGLCREATEIMAGEKHRPROC egl_create_image; - PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image; + PFNEGLCREATEIMAGEKHRPROC egl_create_image = nullptr; + PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image = nullptr; - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d; + PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d = nullptr; - QEGLStreamConvenience *funcs; + QEGLStreamConvenience *funcs = nullptr; static WaylandEglClientBufferIntegrationPrivate *get(WaylandEglClientBufferIntegration *integration) { return shuttingDown ? nullptr : integration->d_ptr.data(); } @@ -206,24 +206,7 @@ public: bool WaylandEglClientBufferIntegrationPrivate::shuttingDown = false; -BufferState::BufferState() - : egl_format(EGL_TEXTURE_RGBA) - , egl_stream(EGL_NO_STREAM_KHR) - , isYInverted(true) - , eglMode(ModeUninitialized) -{} - WaylandEglClientBufferIntegrationPrivate::WaylandEglClientBufferIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - , display_bound(false) - , egl_bind_wayland_display(nullptr) - , egl_unbind_wayland_display(nullptr) - , egl_query_wayland_buffer(nullptr) - , egl_create_image(nullptr) - , egl_destroy_image(nullptr) - , gl_egl_image_target_texture_2d(nullptr) - , funcs(nullptr) { } @@ -394,8 +377,7 @@ void WaylandEglClientBufferIntegrationPrivate::handleEglstreamTexture(WaylandEgl } WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , d_ptr(new WaylandEglClientBufferIntegrationPrivate) + : d_ptr(new WaylandEglClientBufferIntegrationPrivate) { } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 049b8b3fe..37932447c 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -68,8 +68,6 @@ QVector eglbuildSpec() } XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , mDisplay(nullptr) { } @@ -100,7 +98,6 @@ QtWayland::ClientBuffer *XCompositeEglClientBufferIntegration::createBufferFor(w XCompositeEglClientBuffer::XCompositeEglClientBuffer(XCompositeEglClientBufferIntegration *integration, wl_resource *bufferResource) : QtWayland::ClientBuffer(bufferResource) - , m_texture(nullptr) , m_integration(integration) { } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h index 16d9591ba..f57f741c2 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.h @@ -61,7 +61,7 @@ public: inline EGLDisplay eglDisplay() const { return mEglDisplay; } private: - Display *mDisplay; + Display *mDisplay = nullptr; EGLDisplay mEglDisplay; }; @@ -78,7 +78,7 @@ public: } private: - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; XCompositeEglClientBufferIntegration *m_integration; }; diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp index b1c947b53..511a8f6b8 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp @@ -71,9 +71,6 @@ QVector qglx_buildSpec() XCompositeGLXClientBufferIntegration::XCompositeGLXClientBufferIntegration() - : QtWayland::ClientBufferIntegration() - , mDisplay(nullptr) - , mHandler(nullptr) { qDebug() << "Loading GLX integration"; } @@ -122,9 +119,7 @@ QtWayland::ClientBuffer *XCompositeGLXClientBufferIntegration::createBufferFor(w XCompositeGLXClientBuffer::XCompositeGLXClientBuffer(XCompositeGLXClientBufferIntegration *integration, wl_resource *bufferResource) : QtWayland::ClientBuffer(bufferResource) - , m_texture(nullptr) , m_integration(integration) - , m_glxPixmap(0) { } diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h index ccdca7613..23b856e93 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.h @@ -68,9 +68,9 @@ public: PFNGLXRELEASETEXIMAGEEXTPROC m_glxReleaseTexImageEXT; private: - Display *mDisplay; + Display *mDisplay = nullptr; int mScreen; - XCompositeHandler *mHandler; + XCompositeHandler *mHandler = nullptr; }; class XCompositeGLXClientBuffer : public QtWayland::ClientBuffer @@ -86,9 +86,9 @@ public: } private: - QOpenGLTexture *m_texture; + QOpenGLTexture *m_texture = nullptr; XCompositeGLXClientBufferIntegration *m_integration; - GLXPixmap m_glxPixmap; + GLXPixmap m_glxPixmap = 0; }; QT_END_NAMESPACE diff --git a/src/imports/compositor/qwaylandmousetracker.cpp b/src/imports/compositor/qwaylandmousetracker.cpp index 99adef5bf..a39aa0bea 100644 --- a/src/imports/compositor/qwaylandmousetracker.cpp +++ b/src/imports/compositor/qwaylandmousetracker.cpp @@ -48,8 +48,6 @@ class QWaylandMouseTrackerPrivate : public QQuickItemPrivate Q_DECLARE_PUBLIC(QWaylandMouseTracker) public: QWaylandMouseTrackerPrivate() - : windowSystemCursorEnabled(false) - , hovered(false) { QImage cursorImage(64,64,QImage::Format_ARGB32); cursorImage.fill(Qt::transparent); @@ -79,9 +77,9 @@ public: } QPointF mousePos; - bool windowSystemCursorEnabled; + bool windowSystemCursorEnabled = false; QPixmap cursorPixmap; - bool hovered; + bool hovered = false; }; QWaylandMouseTracker::QWaylandMouseTracker(QQuickItem *parent) diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp index ceb07c803..9a7e91e6f 100644 --- a/src/plugins/decorations/bradient/main.cpp +++ b/src/plugins/decorations/bradient/main.cpp @@ -153,14 +153,12 @@ private: QColor m_foregroundColor; QColor m_backgroundColor; QStaticText m_windowTitle; - Button m_clicking; + Button m_clicking = None; }; QWaylandBradientDecoration::QWaylandBradientDecoration() - : QWaylandAbstractDecoration() - , m_clicking(None) { QPalette palette; m_foregroundColor = palette.color(QPalette::Active, QPalette::HighlightedText); diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h b/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h index dde430381..625583913 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglplatformintegration.h @@ -52,8 +52,7 @@ class QWaylandEglPlatformIntegration : public QWaylandIntegration { public: QWaylandEglPlatformIntegration() - : QWaylandIntegration() - , m_client_buffer_integration(new QWaylandEglClientBufferIntegration()) + : m_client_buffer_integration(new QWaylandEglClientBufferIntegration()) { m_client_buffer_integration->initialize(display()); } diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h index 009a12f67..e711133c0 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglplatformintegration.h @@ -52,8 +52,7 @@ class QWaylandXCompositeEglPlatformIntegration : public QWaylandIntegration { public: QWaylandXCompositeEglPlatformIntegration() - : QWaylandIntegration() - , m_client_buffer_integration(new QWaylandXCompositeEGLClientBufferIntegration()) + : m_client_buffer_integration(new QWaylandXCompositeEGLClientBufferIntegration()) { m_client_buffer_integration->initialize(display()); } diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h index a8a70bdd9..32e286c52 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxplatformintegration.h @@ -53,8 +53,7 @@ class QWaylandXCompositeGlxPlatformIntegration : public QWaylandIntegration { public: QWaylandXCompositeGlxPlatformIntegration() - : QWaylandIntegration() - , m_client_buffer_integration(new QWaylandXCompositeGLXIntegration()) + : m_client_buffer_integration(new QWaylandXCompositeGLXIntegration()) { m_client_buffer_integration->initialize(display()); } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp index fee812501..14074625a 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.cpp @@ -55,12 +55,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandIviShellIntegration::QWaylandIviShellIntegration() - : m_iviApplication(nullptr) - , m_iviController(nullptr) - , m_lastSurfaceId(0) - , m_surfaceNumber(0) - , m_useEnvSurfaceId(false) - , m_mutex(QMutex::Recursive) { } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h index 745b3e487..0b575c6c8 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivishellintegration.h @@ -68,12 +68,12 @@ private: uint32_t getNextUniqueSurfaceId(); private: - QtWayland::ivi_application *m_iviApplication; - QtWayland::ivi_controller *m_iviController; - uint32_t m_lastSurfaceId; - uint32_t m_surfaceNumber; - bool m_useEnvSurfaceId; - QMutex m_mutex; + QtWayland::ivi_application *m_iviApplication = nullptr; + QtWayland::ivi_controller *m_iviController = nullptr; + uint32_t m_lastSurfaceId = 0; + uint32_t m_surfaceNumber = 0; + bool m_useEnvSurfaceId = false; + QMutex m_mutex{QMutex::Recursive}; }; } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp index 335aa852c..ec529b124 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface.cpp @@ -52,7 +52,6 @@ QWaylandIviSurface::QWaylandIviSurface(struct ::ivi_surface *ivi_surface, QWayla : QtWayland::ivi_surface(ivi_surface) , QWaylandShellSurface(window) , m_window(window) - , m_extendedWindow(nullptr) { createExtendedSurface(window); } @@ -63,7 +62,6 @@ QWaylandIviSurface::QWaylandIviSurface(struct ::ivi_surface *ivi_surface, QWayla , QWaylandShellSurface(window) , QtWayland::ivi_controller_surface(iviControllerSurface) , m_window(window) - , m_extendedWindow(nullptr) { createExtendedSurface(window); } diff --git a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h index 0a717b398..f24ecd37a 100644 --- a/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h +++ b/src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h @@ -70,7 +70,7 @@ private: void ivi_controller_surface_visibility(int32_t visibility) override; QWaylandWindow *m_window; - QWaylandExtendedSurface *m_extendedWindow; + QWaylandExtendedSurface *m_extendedWindow = nullptr; }; } diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp index 6acf312ed..88056637d 100644 --- a/src/shared/qwaylandinputmethodeventbuilder.cpp +++ b/src/shared/qwaylandinputmethodeventbuilder.cpp @@ -50,16 +50,6 @@ QT_BEGIN_NAMESPACE -QWaylandInputMethodEventBuilder::QWaylandInputMethodEventBuilder() - : m_anchor(0) - , m_cursor(0) - , m_deleteBefore(0) - , m_deleteAfter(0) - , m_preeditCursor(0) - , m_preeditStyles() -{ -} - QWaylandInputMethodEventBuilder::~QWaylandInputMethodEventBuilder() { } diff --git a/src/shared/qwaylandinputmethodeventbuilder_p.h b/src/shared/qwaylandinputmethodeventbuilder_p.h index 3912afc04..a234cf44b 100644 --- a/src/shared/qwaylandinputmethodeventbuilder_p.h +++ b/src/shared/qwaylandinputmethodeventbuilder_p.h @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE class QWaylandInputMethodEventBuilder { public: - QWaylandInputMethodEventBuilder(); + QWaylandInputMethodEventBuilder() = default; ~QWaylandInputMethodEventBuilder(); void reset(); @@ -66,12 +66,12 @@ public: private: QPair replacementForDeleteSurrounding(); - int32_t m_anchor; - int32_t m_cursor; - uint32_t m_deleteBefore; - uint32_t m_deleteAfter; + int32_t m_anchor = 0; + int32_t m_cursor = 0; + uint32_t m_deleteBefore = 0; + uint32_t m_deleteAfter = 0; - int32_t m_preeditCursor; + int32_t m_preeditCursor = 0; QList m_preeditStyles; }; diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index eb99b2e2f..8ee52d736 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -48,14 +48,6 @@ class TestWindow : public QWindow { public: TestWindow() - : focusInEventCount(0) - , focusOutEventCount(0) - , keyPressEventCount(0) - , keyReleaseEventCount(0) - , mousePressEventCount(0) - , mouseReleaseEventCount(0) - , touchEventCount(0) - , keyCode(0) { setSurfaceType(QSurface::RasterSurface); setGeometry(0, 0, 32, 32); @@ -103,15 +95,15 @@ public: QPoint frameOffset() const { return QPoint(frameMargins().left(), frameMargins().top()); } - int focusInEventCount; - int focusOutEventCount; - int keyPressEventCount; - int keyReleaseEventCount; - int mousePressEventCount; - int mouseReleaseEventCount; - int touchEventCount; + int focusInEventCount = 0; + int focusOutEventCount = 0; + int keyPressEventCount = 0; + int keyReleaseEventCount = 0; + int mousePressEventCount = 0; + int mouseReleaseEventCount = 0; + int touchEventCount = 0; - uint keyCode; + uint keyCode = 0; QPoint mousePressPos; }; @@ -404,7 +396,6 @@ class DndWindow : public QWindow public: DndWindow(QWindow *parent = nullptr) : QWindow(parent) - , dragStarted(false) { QImage cursorImage(64,64,QImage::Format_ARGB32); cursorImage.fill(Qt::blue); @@ -412,7 +403,7 @@ public: } ~DndWindow(){} QPoint frameOffset() const { return QPoint(frameMargins().left(), frameMargins().top()); } - bool dragStarted; + bool dragStarted = false; protected: void mousePressEvent(QMouseEvent *event) override diff --git a/tests/auto/client/shared/mockcompositor.cpp b/tests/auto/client/shared/mockcompositor.cpp index 2f1d68b01..1d76cec12 100644 --- a/tests/auto/client/shared/mockcompositor.cpp +++ b/tests/auto/client/shared/mockcompositor.cpp @@ -37,9 +37,6 @@ #include MockCompositor::MockCompositor() - : m_alive(true) - , m_ready(false) - , m_compositor(0) { pthread_create(&m_thread, 0, run, this); diff --git a/tests/auto/client/shared/mockcompositor.h b/tests/auto/client/shared/mockcompositor.h index 747da38fa..c6de12376 100644 --- a/tests/auto/client/shared/mockcompositor.h +++ b/tests/auto/client/shared/mockcompositor.h @@ -212,13 +212,13 @@ private: static void *run(void *data); - bool m_alive; - bool m_ready; + bool m_alive = true; + bool m_ready = false; pthread_t m_thread; QMutex m_mutex; QWaitCondition m_waitCondition; - Impl::Compositor *m_compositor; + Impl::Compositor *m_compositor = nullptr; QList m_commandQueue; }; diff --git a/tests/auto/client/shared/mockinput.cpp b/tests/auto/client/shared/mockinput.cpp index 9cea85b6d..8b7592824 100644 --- a/tests/auto/client/shared/mockinput.cpp +++ b/tests/auto/client/shared/mockinput.cpp @@ -232,10 +232,7 @@ void Seat::seat_get_touch(Resource *resource, uint32_t id) } Keyboard::Keyboard(Compositor *compositor) - : wl_keyboard() - , m_compositor(compositor) - , m_focusResource(nullptr) - , m_focus(nullptr) + : m_compositor(compositor) { } @@ -286,10 +283,7 @@ void Keyboard::keyboard_destroy_resource(wl_keyboard::Resource *resource) } Pointer::Pointer(Compositor *compositor) - : wl_pointer() - , m_compositor(compositor) - , m_focusResource(nullptr) - , m_focus(nullptr) + : m_compositor(compositor) { } @@ -393,10 +387,7 @@ DataOffer::DataOffer() } DataDevice::DataDevice(Compositor *compositor) - : wl_data_device() - , m_compositor(compositor) - , m_dataOffer(nullptr) - , m_focus(nullptr) + : m_compositor(compositor) { } diff --git a/tests/auto/client/shared/mockinput.h b/tests/auto/client/shared/mockinput.h index 9c217b6ac..5760ab40c 100644 --- a/tests/auto/client/shared/mockinput.h +++ b/tests/auto/client/shared/mockinput.h @@ -85,8 +85,8 @@ protected: private: Compositor *m_compositor; - Resource *m_focusResource; - Surface *m_focus; + Resource *m_focusResource = nullptr; + Surface *m_focus = nullptr; }; class Pointer : public QtWaylandServer::wl_pointer @@ -108,8 +108,8 @@ protected: private: Compositor *m_compositor; - Resource *m_focusResource; - Surface *m_focus; + Resource *m_focusResource = nullptr; + Surface *m_focus = nullptr; }; class Touch : public QtWaylandServer::wl_touch @@ -146,8 +146,8 @@ protected: private: Compositor *m_compositor; - QtWaylandServer::wl_data_offer *m_dataOffer; - Surface* m_focus; + QtWaylandServer::wl_data_offer *m_dataOffer = nullptr; + Surface* m_focus = nullptr; }; class DataDeviceManager : public QtWaylandServer::wl_data_device_manager diff --git a/tests/auto/client/shared/mocksurface.cpp b/tests/auto/client/shared/mocksurface.cpp index 7aa2a00b2..98a9615a6 100644 --- a/tests/auto/client/shared/mocksurface.cpp +++ b/tests/auto/client/shared/mocksurface.cpp @@ -62,10 +62,8 @@ void Compositor::sendSurfaceLeave(void *data, const QList ¶meters) Surface::Surface(wl_client *client, uint32_t id, int v, Compositor *compositor) : QtWaylandServer::wl_surface(client, id, v) - , m_buffer(nullptr) , m_compositor(compositor) , m_mockSurface(new MockSurface(this)) - , m_mapped(false) { } diff --git a/tests/auto/client/shared/mocksurface.h b/tests/auto/client/shared/mocksurface.h index 5155599bb..8bf6eb755 100644 --- a/tests/auto/client/shared/mocksurface.h +++ b/tests/auto/client/shared/mocksurface.h @@ -63,12 +63,12 @@ protected: uint32_t callback) override; void surface_commit(Resource *resource) override; private: - wl_resource *m_buffer; + wl_resource *m_buffer = nullptr; Compositor *m_compositor; QSharedPointer m_mockSurface; QList m_frameCallbackList; - bool m_mapped; + bool m_mapped = false; }; } diff --git a/tests/auto/compositor/compositor/mockclient.cpp b/tests/auto/compositor/compositor/mockclient.cpp index 4720b0d9f..e6eac1553 100644 --- a/tests/auto/compositor/compositor/mockclient.cpp +++ b/tests/auto/compositor/compositor/mockclient.cpp @@ -47,14 +47,6 @@ const struct wl_registry_listener MockClient::registryListener = { MockClient::MockClient() : display(wl_display_connect("wayland-qt-test-0")) - , compositor(nullptr) - , registry(nullptr) - , wlshell(nullptr) - , xdgShell(nullptr) - , iviApplication(nullptr) - , refreshRate(-1) - , error(0 /* means no error according to spec */) - , protocolError({0, 0, nullptr}) { if (!display) qFatal("MockClient(): wl_display_connect() failed"); @@ -223,7 +215,6 @@ ivi_surface *MockClient::createIviSurface(wl_surface *surface, uint iviId) } ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm) - : handle(nullptr) { int stride = size.width() * 4; int alloc = stride * size.height(); diff --git a/tests/auto/compositor/compositor/mockclient.h b/tests/auto/compositor/compositor/mockclient.h index dd50f9a28..8933f8327 100644 --- a/tests/auto/compositor/compositor/mockclient.h +++ b/tests/auto/compositor/compositor/mockclient.h @@ -44,7 +44,7 @@ public: ShmBuffer(const QSize &size, wl_shm *shm); ~ShmBuffer(); - struct wl_buffer *handle; + struct wl_buffer *handle = nullptr; struct wl_shm_pool *shm_pool; QImage image; }; @@ -63,29 +63,29 @@ public: ivi_surface *createIviSurface(wl_surface *surface, uint iviId); wl_display *display; - wl_compositor *compositor; + wl_compositor *compositor = nullptr; QMap m_outputs; wl_shm *shm; - wl_registry *registry; - wl_shell *wlshell; - xdg_shell *xdgShell; - ivi_application *iviApplication; + wl_registry *registry = nullptr; + wl_shell *wlshell = nullptr; + xdg_shell *xdgShell = nullptr; + ivi_application *iviApplication = nullptr; QList m_seats; QRect geometry; QSize resolution; - int refreshRate; + int refreshRate = -1; QWaylandOutputMode currentMode; QWaylandOutputMode preferredMode; QList modes; int fd; - int error; + int error = 0 /* means no error according to spec */; struct { - uint id; - uint code; - const wl_interface *interface; + uint id = 0; + uint code = 0; + const wl_interface *interface = nullptr; } protocolError; private slots: diff --git a/tests/auto/compositor/compositor/testcompositor.cpp b/tests/auto/compositor/compositor/testcompositor.cpp index f91d0d3f1..710bb7b3a 100644 --- a/tests/auto/compositor/compositor/testcompositor.cpp +++ b/tests/auto/compositor/compositor/testcompositor.cpp @@ -33,8 +33,7 @@ #include TestCompositor::TestCompositor(bool createInputDev) - : QWaylandCompositor() - , shell(new QWaylandWlShell(this)) + : shell(new QWaylandWlShell(this)) , m_createSeat(createInputDev) { setSocketName("wayland-qt-test-0"); -- cgit v1.2.3