diff --git a/src/plugins/platforms/wayland/global/qwaylandclientextension.cpp b/src/plugins/platforms/wayland/global/qwaylandclientextension.cpp index 60a8944f8bf..125b1e19d94 100644 --- a/src/plugins/platforms/wayland/global/qwaylandclientextension.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/global/qwaylandclientextension_p.h b/src/plugins/platforms/wayland/global/qwaylandclientextension_p.h index 0fd59b3f782..69cc46a0a48 100644 --- a/src/plugins/platforms/wayland/global/qwaylandclientextension_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration.cpp index 013ddae9f5a..d966a1919d2 100644 --- a/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -44,7 +44,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandServerBuffer::QWaylandServerBuffer() - : m_user_data(nullptr) { } diff --git a/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration_p.h b/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration_p.h index 3b8b3a6de2f..7439087d885 100644 --- a/src/plugins/platforms/wayland/hardwareintegration/qwaylandserverbufferintegration_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp b/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp index ceb07c8032d..9a7e91e6f7b 100644 --- a/src/plugins/platforms/wayland/plugins/decorations/bradient/main.cpp +++ b/src/plugins/platforms/wayland/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/wayland/qwaylandabstractdecoration.cpp b/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp index 6a7a2ef4cdb..c20b70e9e29 100644 --- a/src/plugins/platforms/wayland/qwaylandabstractdecoration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandbuffer.cpp b/src/plugins/platforms/wayland/qwaylandbuffer.cpp index 2dc99b3b758..9792cdd6136 100644 --- a/src/plugins/platforms/wayland/qwaylandbuffer.cpp +++ b/src/plugins/platforms/wayland/qwaylandbuffer.cpp @@ -47,8 +47,6 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBuffer::QWaylandBuffer() - : mBuffer(nullptr) - , mBusy(false) { } diff --git a/src/plugins/platforms/wayland/qwaylandbuffer_p.h b/src/plugins/platforms/wayland/qwaylandbuffer_p.h index 9e8cba2e490..156ea9530b4 100644 --- a/src/plugins/platforms/wayland/qwaylandbuffer_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 83912035a4f..4411ba65ccd 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylanddatadevice_p.h b/src/plugins/platforms/wayland/qwaylanddatadevice_p.h index 7fb0003b4dd..29461930b37 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylanddataoffer.cpp b/src/plugins/platforms/wayland/qwaylanddataoffer.cpp index 2491c658b12..35085a7f0d5 100644 --- a/src/plugins/platforms/wayland/qwaylanddataoffer.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 179c0454e0c..abb0845225f 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 35d861760e5..0a7ea427a5d 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandinputcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp index 16ee057c54e..58ad90d41b5 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandinputcontext_p.h b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h index a131bc5bdf6..a554f23011c 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index b34504a1f4b..93344d13fed 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 267e481ac9c..fe1655c9f30 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandintegration_p.h b/src/plugins/platforms/wayland/qwaylandintegration_p.h index 17144b8d716..7ce79e6da1e 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp index 1c9ce23ba43..38d97a91dfb 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandscreen_p.h b/src/plugins/platforms/wayland/qwaylandscreen_p.h index 674e1a9134e..37c35cffff4 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index 24554ee44b4..cbfdf51576e 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandshmbackingstore_p.h b/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h index 251368efd47..628d1858be1 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandsubsurface.cpp b/src/plugins/platforms/wayland/qwaylandsubsurface.cpp index 36fdd1c7a24..2ff966cbc66 100644 --- a/src/plugins/platforms/wayland/qwaylandsubsurface.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandsubsurface_p.h b/src/plugins/platforms/wayland/qwaylandsubsurface_p.h index 00fb8d8edab..36a92a7559e 100644 --- a/src/plugins/platforms/wayland/qwaylandsubsurface_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 75dfaa49910..52461dc38bc 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index fca96f30d50..a74f188274f 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp index c519126e5a5..785a0a44d7c 100644 --- a/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwlshellintegration.cpp b/src/plugins/platforms/wayland/qwaylandwlshellintegration.cpp index e516371086e..81c46be29e6 100644 --- a/src/plugins/platforms/wayland/qwaylandwlshellintegration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwlshellintegration_p.h b/src/plugins/platforms/wayland/qwaylandwlshellintegration_p.h index 2e3ac3cc1cf..7a6b53524a9 100644 --- a/src/plugins/platforms/wayland/qwaylandwlshellintegration_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwlshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandwlshellsurface.cpp index 7c8d5172147..00b070f3fd1 100644 --- a/src/plugins/platforms/wayland/qwaylandwlshellsurface.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwlshellsurface_p.h b/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h index 62583949b68..708c6f1132b 100644 --- a/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgpopup.cpp b/src/plugins/platforms/wayland/qwaylandxdgpopup.cpp index d5fc4969362..46a12a828a1 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgpopup.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgpopup_p.h b/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h index f45e717a953..85bd589bf7e 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/qwaylandxdgshell.cpp index 6a99306081a..8b252b95323 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshell_p.h b/src/plugins/platforms/wayland/qwaylandxdgshell_p.h index f462f28281d..e01104cadf3 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshell_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshellintegration.cpp b/src/plugins/platforms/wayland/qwaylandxdgshellintegration.cpp index 7c40d2dd7fb..5fa4385d65b 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellintegration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshellintegration_p.h b/src/plugins/platforms/wayland/qwaylandxdgshellintegration_p.h index cc4493e3e1b..ed307a5de8b 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellintegration_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgshellintegration_p.h @@ -72,7 +72,7 @@ public: private: QWaylandXdgShellIntegration(QWaylandDisplay *display); - QWaylandXdgShell *m_xdgShell; + QWaylandXdgShell *m_xdgShell = nullptr; }; } diff --git a/src/plugins/platforms/wayland/qwaylandxdgshellv6.cpp b/src/plugins/platforms/wayland/qwaylandxdgshellv6.cpp index 1a60d65333f..69bbf55b866 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellv6.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshellv6_p.h b/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h index 769f19837b4..122beed0c8c 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshellv6integration.cpp b/src/plugins/platforms/wayland/qwaylandxdgshellv6integration.cpp index a3dca70bf56..cb82354b64c 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellv6integration.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgshellv6integration_p.h b/src/plugins/platforms/wayland/qwaylandxdgshellv6integration_p.h index f22b6a66adf..bdfd1972338 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellv6integration_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgshellv6integration_p.h @@ -71,7 +71,7 @@ public: private: QWaylandXdgShellV6Integration(QWaylandDisplay *display); - QWaylandXdgShellV6 *m_xdgShell; + QWaylandXdgShellV6 *m_xdgShell = nullptr; }; } diff --git a/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp b/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp index 60266af689d..40ed9f07aa1 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgsurface.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandxdgsurface_p.h b/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h index 00154ade072..fa79632068a 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp b/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp index 6acf312ed59..88056637df9 100644 --- a/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder_p.h b/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder_p.h index 3912afc0424..a234cf44be8 100644 --- a/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder_p.h +++ b/src/plugins/platforms/wayland/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/wayland/client/tst_client.cpp b/tests/auto/wayland/client/tst_client.cpp index eb99b2e2f5f..8ee52d7364f 100644 --- a/tests/auto/wayland/client/tst_client.cpp +++ b/tests/auto/wayland/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/wayland/shared/mockcompositor.cpp b/tests/auto/wayland/shared/mockcompositor.cpp index 2f1d68b0147..1d76cec1200 100644 --- a/tests/auto/wayland/shared/mockcompositor.cpp +++ b/tests/auto/wayland/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/wayland/shared/mockcompositor.h b/tests/auto/wayland/shared/mockcompositor.h index 747da38fa06..c6de12376a3 100644 --- a/tests/auto/wayland/shared/mockcompositor.h +++ b/tests/auto/wayland/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/wayland/shared/mockinput.cpp b/tests/auto/wayland/shared/mockinput.cpp index 9cea85b6d12..8b7592824d7 100644 --- a/tests/auto/wayland/shared/mockinput.cpp +++ b/tests/auto/wayland/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/wayland/shared/mockinput.h b/tests/auto/wayland/shared/mockinput.h index 9c217b6acd2..5760ab40c63 100644 --- a/tests/auto/wayland/shared/mockinput.h +++ b/tests/auto/wayland/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/wayland/shared/mocksurface.cpp b/tests/auto/wayland/shared/mocksurface.cpp index 7aa2a00b2da..98a9615a624 100644 --- a/tests/auto/wayland/shared/mocksurface.cpp +++ b/tests/auto/wayland/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/wayland/shared/mocksurface.h b/tests/auto/wayland/shared/mocksurface.h index 5155599bbfa..8bf6eb755a2 100644 --- a/tests/auto/wayland/shared/mocksurface.h +++ b/tests/auto/wayland/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; }; }