summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemtrayicon.h2
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h6
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h6
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h6
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h6
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h16
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h17
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h16
-rw-r--r--src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h16
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h5
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h5
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h4
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h20
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h20
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h5
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h16
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h20
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h16
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h17
-rw-r--r--src/plugins/platforms/wayland/qwaylandinputcontext.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowswindowclassdescription.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowswindowclassdescription.h3
-rw-r--r--src/plugins/platforms/windows/qwindowswindowclassregistry.cpp54
-rw-r--r--src/plugins/platforms/windows/qwindowswindowclassregistry.h6
24 files changed, 77 insertions, 225 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
index 9a491d4d058..35fb7f24dd5 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
@@ -29,7 +29,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSStatusItem);
QT_BEGIN_NAMESPACE
-class Q_GUI_EXPORT QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon
+class QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon
{
public:
QCocoaSystemTrayIcon() {}
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h
index 13dbdfbfbab..41946105f08 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/dmabuf-server/dmabufserverbufferintegration.h
@@ -1,15 +1,13 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef DMABUFSERVERBUFFERINTEGRATION_H
-#define DMABUFSERVERBUFFERINTEGRATION_H
+#pragma once
#include <QtCore/QVariant>
#include <QtWaylandClient/private/qwayland-wayland.h>
#include "qwayland-qt-dmabuf-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
-#include "dmabufserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtCore/QTextStream>
@@ -107,5 +105,3 @@ void DmaBufServerBufferIntegration::glEGLImageTargetTexture2DOES(GLenum target,
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h
index a06bc96b87d..68db25dbfc5 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/drm-egl-server/drmeglserverbufferintegration.h
@@ -1,15 +1,13 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef DRMEGLSERVERBUFFERINTEGRATION_H
-#define DRMEGLSERVERBUFFERINTEGRATION_H
+#pragma once
#include <QtWaylandClient/private/qwayland-wayland.h>
#include <QtCore/QVariant>
#include "qwayland-drm-egl-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
-#include "drmeglserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtCore/QTextStream>
@@ -102,5 +100,3 @@ void DrmEglServerBufferIntegration::glEGLImageTargetTexture2DOES (GLenum target,
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h
index 344046ae182..d112fb32385 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/shm-emulation-server/shmserverbufferintegration.h
@@ -1,14 +1,12 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef SHMSERVERBUFFERINTEGRATION_H
-#define SHMSERVERBUFFERINTEGRATION_H
+#pragma once
#include <QtWaylandClient/private/qwayland-wayland.h>
#include "qwayland-shm-emulation-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
-#include "shmserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtCore/QTextStream>
@@ -51,5 +49,3 @@ private:
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h
index 2f0867a8197..9d86c61a366 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/vulkan-server/vulkanserverbufferintegration.h
@@ -1,14 +1,12 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef VULKANSERVERBUFFERINTEGRATION_H
-#define VULKANSERVERBUFFERINTEGRATION_H
+#pragma once
#include <QtWaylandClient/private/qwayland-wayland.h>
#include "qwayland-qt-vulkan-server-buffer-unstable-v1.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
-#include "vulkanserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtCore/QTextStream>
@@ -62,5 +60,3 @@ private:
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h
index 9890d14f137..756d139cac1 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglclientbufferintegration_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QWAYLANDEGLINTEGRATION_H
-#define QWAYLANDEGLINTEGRATION_H
+#pragma once
#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
@@ -59,5 +47,3 @@ private:
QT_END_NAMESPACE
}
-
-#endif // QWAYLANDEGLINTEGRATION_H
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h
index aa45d1b1759..b18c01ac267 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglinclude_p.h
@@ -1,20 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QWAYLANDEGLINCLUDE_H
-#define QWAYLANDEGLINCLUDE_H
+#pragma once
#include <string.h>
#include <wayland-client-core.h>
@@ -23,5 +10,3 @@
#define EGL_EGLEXT_PROTOTYPES
#include <QtGui/private/qt_egl_p.h>
-
-#endif // QWAYLANDEGLINCLUDE_H
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h
index dc2e0319519..863bd7f0e53 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandeglwindow_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QWAYLANDEGLWINDOW_H
-#define QWAYLANDEGLWINDOW_H
+#pragma once
#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandeglinclude_p.h"
@@ -72,5 +60,3 @@ private:
}
QT_END_NAMESPACE
-
-#endif // QWAYLANDEGLWINDOW_H
diff --git a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h
index 543c31fd727..7ea7019dfe5 100644
--- a/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h
+++ b/src/plugins/platforms/wayland/plugins/hardwareintegration/wayland-egl/qwaylandglcontext_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QWAYLANDGLCONTEXT_H
-#define QWAYLANDGLCONTEXT_H
+#pragma once
#include "qwaylandeglinclude_p.h" //must be first
@@ -71,5 +59,3 @@ private:
}
QT_END_NAMESPACE
-
-#endif // QWAYLANDGLCONTEXT_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
index 006f648e4d6..693c179fe29 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1integration.h
@@ -1,8 +1,7 @@
// Copyright (C) 2018 Pier Luigi Fiorini <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
-#define QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
+#pragma once
#include <wayland-client-core.h>
#include <QtWaylandClient/private/qwayland-wayland.h>
@@ -27,5 +26,3 @@ public:
} // namespace QtWaylandClient
QT_END_NAMESPACE
-
-#endif // QWAYLANDFULLSCREENSHELLV1INTEGRATION_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h
index 0a82e5eee2a..12f551d1031 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/fullscreen-shell-v1/qwaylandfullscreenshellv1surface.h
@@ -1,8 +1,7 @@
// Copyright (C) 2018 Pier Luigi Fiorini <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDFULLSCREENSHELLV1SURFACE_H
-#define QWAYLANDFULLSCREENSHELLV1SURFACE_H
+#pragma once
#include <QtWaylandClient/qtwaylandclientglobal.h>
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
@@ -28,5 +27,3 @@ private:
} // namespace QtWaylandClient
QT_END_NAMESPACE
-
-#endif // QWAYLANDFULLSCREENSHELLV1SURFACE_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h
index 780f5f3268e..6d86600bad2 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h
@@ -82,8 +82,8 @@ private:
friend class QWaylandWindow;
};
-QT_END_NAMESPACE
+} // namespace QtWaylandClient
-}
+QT_END_NAMESPACE
#endif // QWAYLANDSHELLSURFACE_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h
index bddb5c614e0..fd107f825e1 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgactivationv1_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2020 Aleix Pol Gonzalez <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDXDGACTIVATIONV1_P_H
-#define QWAYLANDXDGACTIVATIONV1_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include <QObject>
#include "qwayland-xdg-activation-v1.h"
@@ -52,8 +40,6 @@ public:
const QString &app_id);
};
-QT_END_NAMESPACE
-
-}
+} // namespace QtWaylandClient
-#endif // QWAYLANDXDGACTIVATIONV1_P_H
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h
index 8a0cc9e79a7..fc2e67b97c4 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdecorationv1_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDXDGDECORATIONV1_P_H
-#define QWAYLANDXDGDECORATIONV1_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include "qwayland-xdg-decoration-unstable-v1.h"
@@ -56,8 +44,6 @@ private:
bool m_configured = false;
};
-QT_END_NAMESPACE
-
-}
+} // namespace QtWaylandClient
-#endif // QWAYLANDXDGDECORATIONV1_P_H
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h
index f5465a63e6f..27ebc8d5afa 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgdialogv1_p.h
@@ -1,8 +1,7 @@
// Copyright (C) 2022 David Reondo <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDDIALOGV1_P_H
-#define QWAYLANDDIALOGV1_P_H
+#pragma once
#include <qwayland-xdg-dialog-v1.h>
@@ -28,5 +27,3 @@ public:
} // namespace QtWaylandClient
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h
index c993e390a24..aa48e38c34b 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgexporterv2_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2022 David Reondo <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDXDGEXPORTERV2_H
-#define QWAYLANDXDGEXPORTERV2_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include <qwayland-xdg-foreign-unstable-v2.h>
@@ -45,5 +33,3 @@ public:
}
QT_END_NAMESPACE
-
-#endif // QWAYLANDXDGEXPORTERV2_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index a12311eff74..bfecff41758 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -2,19 +2,7 @@
// Copyright (C) 2017 Eurogiciel, author: <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDXDGSHELL_H
-#define QWAYLANDXDGSHELL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include "qwayland-xdg-shell.h"
@@ -201,8 +189,6 @@ private:
friend class QWaylandXdgSurface;
};
-QT_END_NAMESPACE
-
-}
+} // namespace QtWaylandClient
-#endif // QWAYLANDXDGSHELL_H
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h
index b7627d80462..82b2e005edd 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration_p.h
@@ -1,19 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDXDGSHELLINTEGRATION_P_H
-#define QWAYLANDXDGSHELLINTEGRATION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include "qwayland-xdg-shell.h"
@@ -47,5 +35,3 @@ private:
}
QT_END_NAMESPACE
-
-#endif // QWAYLANDXDGSHELLINTEGRATION_P_H
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h
index 63e379c4daf..25e06183f2f 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1_p.h
@@ -2,19 +2,7 @@
// Copyright (C) 2024 David Edmundson <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#ifndef QWAYLANDTOPLEVELICONV1_P_H
-#define QWAYLANDTOPLEVELICONV1_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
+#pragma once
#include "wayland-xdg-shell-client-protocol.h"
#include <qwayland-xdg-toplevel-icon-v1.h>
@@ -45,8 +33,7 @@ private:
QList<int> mPreferredSizes;
QWaylandDisplay *mDisplay;
};
+
} // namespace QtWaylandClient
QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp
index 5ab285ad97d..0ccc4dba57a 100644
--- a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp
+++ b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp
@@ -192,12 +192,10 @@ void QWaylandInputContext::setFocusObject(QObject *object)
if (window && window->handle()) {
if (mCurrentWindow.data() != window) {
if (!inputMethodAccepted()) {
- if (mCurrentWindow) {
- auto *surface = static_cast<QWaylandWindow *>(mCurrentWindow->handle())->wlSurface();
- if (surface)
- inputInterface->disableSurface(surface);
- mCurrentWindow.clear();
- }
+ auto *surface = static_cast<QWaylandWindow *>(window->handle())->wlSurface();
+ if (surface)
+ inputInterface->disableSurface(surface);
+ mCurrentWindow.clear();
} else {
auto *surface = static_cast<QWaylandWindow *>(window->handle())->wlSurface();
if (surface) {
diff --git a/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp b/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp
index 63e16260b62..e2e46a7b215 100644
--- a/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp
+++ b/src/plugins/platforms/windows/qwindowswindowclassdescription.cpp
@@ -75,4 +75,14 @@ QWindowsWindowClassDescription QWindowsWindowClassDescription::fromWindow(const
return description;
}
+QDebug operator<<(QDebug dbg, const QWindowsWindowClassDescription &description)
+{
+ dbg << description.name
+ << " style=0x" << Qt::hex << description.style << Qt::dec
+ << " brush=" << description.brush
+ << " hasIcon=" << description.hasIcon;
+
+ return dbg;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowswindowclassdescription.h b/src/plugins/platforms/windows/qwindowswindowclassdescription.h
index 9423abf9d2d..3acca65b8a2 100644
--- a/src/plugins/platforms/windows/qwindowswindowclassdescription.h
+++ b/src/plugins/platforms/windows/qwindowswindowclassdescription.h
@@ -23,6 +23,9 @@ struct QWindowsWindowClassDescription
HBRUSH brush{ nullptr };
bool hasIcon{ false };
bool shouldAddPrefix{ true };
+
+private:
+ friend QDebug operator<<(QDebug dbg, const QWindowsWindowClassDescription &description);
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp b/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp
index c330720a09c..8bf2fb887f1 100644
--- a/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp
+++ b/src/plugins/platforms/windows/qwindowswindowclassregistry.cpp
@@ -18,8 +18,8 @@ Q_LOGGING_CATEGORY(lcQpaWindowClass, "qt.qpa.windowclass")
QWindowsWindowClassRegistry *QWindowsWindowClassRegistry::m_instance = nullptr;
-QWindowsWindowClassRegistry::QWindowsWindowClassRegistry(WNDPROC proc)
- : m_proc(proc)
+QWindowsWindowClassRegistry::QWindowsWindowClassRegistry(WNDPROC defaultProcedure)
+ : m_defaultProcedure(defaultProcedure)
{
m_instance = this;
}
@@ -69,25 +69,19 @@ QString QWindowsWindowClassRegistry::registerWindowClass(const QWindowsWindowCla
// add a UUID. The check needs to be performed for each name
// in case new message windows are added (QTBUG-81347).
// Note: GetClassInfo() returns != 0 when a class exists.
- const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
- WNDCLASS wcinfo;
- const bool classExists = GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(className.utf16()), &wcinfo) != FALSE
- && wcinfo.lpfnWndProc != description.procedure;
-
- if (classExists)
+ if (shouldDecorateWindowClassName(description))
className += QUuid::createUuid().toString();
if (m_registeredWindowClassNames.contains(className)) // already registered in our list
return className;
- WNDCLASSEX wc;
+ const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
+
+ WNDCLASSEX wc{};
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = description.style;
wc.lpfnWndProc = description.procedure;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
wc.hInstance = appInstance;
- wc.hCursor = nullptr;
wc.hbrBackground = description.brush;
if (description.hasIcon) {
wc.hIcon = static_cast<HICON>(LoadImage(appInstance, L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE));
@@ -98,31 +92,25 @@ QString QWindowsWindowClassRegistry::registerWindowClass(const QWindowsWindowCla
}
else {
wc.hIcon = static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
- wc.hIconSm = nullptr;
}
}
- else {
- wc.hIcon = nullptr;
- wc.hIconSm = nullptr;
- }
- wc.lpszMenuName = nullptr;
wc.lpszClassName = reinterpret_cast<LPCWSTR>(className.utf16());
ATOM atom = RegisterClassEx(&wc);
if (!atom)
- qErrnoWarning("QApplication::regClass: Registering window class '%s' failed.",
- qPrintable(className));
+ qCWarning(lcQpaWindowClass) << "Failed to register window class" << className
+ << "(" << qt_error_string(-1) << ")";
m_registeredWindowClassNames.insert(className);
- qCDebug(lcQpaWindowClass).nospace() << __FUNCTION__ << ' ' << className
- << " style=0x" << Qt::hex << description.style << Qt::dec
- << " brush=" << description.brush << " icon=" << description.hasIcon << " atom=" << atom;
+
+ qCDebug(lcQpaWindowClass).nospace() << __FUNCTION__ << ' ' << className << ' ' << description << " atom=" << atom;
+
return className;
}
QString QWindowsWindowClassRegistry::registerWindowClass(const QWindow *window)
{
- return registerWindowClass(QWindowsWindowClassDescription::fromWindow(window, m_proc));
+ return registerWindowClass(QWindowsWindowClassDescription::fromWindow(window, m_defaultProcedure));
}
QString QWindowsWindowClassRegistry::registerWindowClass(QString name, WNDPROC procedure)
@@ -130,13 +118,29 @@ QString QWindowsWindowClassRegistry::registerWindowClass(QString name, WNDPROC p
return registerWindowClass(QWindowsWindowClassDescription::fromName(name, procedure));
}
+bool QWindowsWindowClassRegistry::shouldDecorateWindowClassName(const QWindowsWindowClassDescription &description) const
+{
+ return shouldDecorateWindowClassName(description.name, description.procedure);
+}
+
+bool QWindowsWindowClassRegistry::shouldDecorateWindowClassName(const QString &name, WNDPROC procedure) const
+{
+ const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
+
+ WNDCLASS wc{};
+
+ return GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(name.utf16()), &wc) != FALSE
+ && wc.lpfnWndProc != procedure;
+}
+
void QWindowsWindowClassRegistry::unregisterWindowClasses()
{
const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
for (const QString &name : std::as_const(m_registeredWindowClassNames)) {
if (!UnregisterClass(reinterpret_cast<LPCWSTR>(name.utf16()), appInstance) && QWindowsContext::verbose)
- qErrnoWarning("UnregisterClass failed for '%s'", qPrintable(name));
+ qCWarning(lcQpaWindowClass) << "Failed to unregister window class" << name
+ << "(" << qt_error_string(-1) << ")";
}
m_registeredWindowClassNames.clear();
}
diff --git a/src/plugins/platforms/windows/qwindowswindowclassregistry.h b/src/plugins/platforms/windows/qwindowswindowclassregistry.h
index c19b4f616fb..c4a36b7f3c4 100644
--- a/src/plugins/platforms/windows/qwindowswindowclassregistry.h
+++ b/src/plugins/platforms/windows/qwindowswindowclassregistry.h
@@ -22,7 +22,7 @@ class QWindowsWindowClassRegistry
{
Q_DISABLE_COPY_MOVE(QWindowsWindowClassRegistry)
public:
- QWindowsWindowClassRegistry(WNDPROC proc);
+ QWindowsWindowClassRegistry(WNDPROC defaultProcedure);
~QWindowsWindowClassRegistry();
static QWindowsWindowClassRegistry *instance();
@@ -34,11 +34,13 @@ public:
private:
static QString classNamePrefix();
+ bool shouldDecorateWindowClassName(const QWindowsWindowClassDescription &description) const;
+ bool shouldDecorateWindowClassName(const QString &name, WNDPROC procedure) const;
void unregisterWindowClasses();
static QWindowsWindowClassRegistry *m_instance;
- WNDPROC m_proc;
+ WNDPROC m_defaultProcedure;
QSet<QString> m_registeredWindowClassNames;
};