From 227ab071be63b1f186a4c8cc05a3255eaefacda9 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 19 Apr 2022 13:14:26 +0300 Subject: [PATCH] Run .clang-format --- src/wayland/appmenu_interface.h | 3 +- .../autotests/client/test_drag_drop.cpp | 14 ++--- src/wayland/autotests/client/test_error.cpp | 8 +-- .../autotests/client/test_fake_input.cpp | 8 +-- src/wayland/autotests/client/test_idle.cpp | 8 +-- .../client/test_plasma_activities.cpp | 8 +-- .../client/test_plasma_virtual_desktop.cpp | 8 +-- .../autotests/client/test_plasmashell.cpp | 14 ++--- .../client/test_pointer_constraints.cpp | 8 +-- .../autotests/client/test_selection.cpp | 7 +-- .../test_server_side_decoration_palette.cpp | 8 +-- src/wayland/autotests/client/test_shadow.cpp | 8 +-- .../autotests/client/test_text_input_v2.cpp | 8 +-- .../autotests/client/test_wayland_appmenu.cpp | 8 +-- .../autotests/client/test_wayland_blur.cpp | 8 +-- .../client/test_wayland_contrast.cpp | 8 +-- .../autotests/client/test_wayland_seat.cpp | 11 ++-- .../autotests/client/test_wayland_slide.cpp | 8 +-- .../autotests/client/test_xdg_foreign.cpp | 8 +-- .../autotests/client/test_xdg_shell.cpp | 24 ++++----- .../server/test_datacontrol_interface.cpp | 8 +-- src/wayland/datadevice_interface_p.h | 3 +- src/wayland/display.cpp | 5 +- src/wayland/display.h | 2 +- src/wayland/drmleasedevice_v1_interface.cpp | 8 +-- src/wayland/drmleasedevice_v1_interface_p.h | 5 +- src/wayland/keyboard_interface.cpp | 8 +-- src/wayland/keyboard_interface_p.h | 6 ++- src/wayland/layershell_v1_interface.h | 7 ++- src/wayland/linuxdmabufv1clientbuffer.cpp | 5 +- src/wayland/linuxdmabufv1clientbuffer.h | 6 ++- src/wayland/output_interface.cpp | 3 +- src/wayland/output_interface.h | 3 +- src/wayland/outputchangeset_v2.h | 2 +- .../outputconfiguration_v2_interface.cpp | 53 +++++++++---------- .../outputconfiguration_v2_interface.h | 7 ++- src/wayland/outputdevice_v2_interface.cpp | 44 ++++++++------- src/wayland/outputdevice_v2_interface.h | 3 +- src/wayland/outputmanagement_v2_interface.cpp | 4 +- src/wayland/seat_interface.h | 1 - src/wayland/seat_interface_p.h | 21 +++++--- src/wayland/shadow_interface.cpp | 35 ++++++------ src/wayland/shmclientbuffer.cpp | 3 +- src/wayland/surface_interface.cpp | 12 ++--- src/wayland/surface_interface_p.h | 6 ++- src/wayland/tests/paneltest.cpp | 3 +- src/wayland/textinput_v3_interface_p.h | 3 +- src/wayland/utils.h | 3 +- src/wayland/xdgdecoration_v1_interface.h | 7 ++- src/wayland/xdgshell_interface_p.h | 6 ++- 50 files changed, 247 insertions(+), 220 deletions(-) diff --git a/src/wayland/appmenu_interface.h b/src/wayland/appmenu_interface.h index 1f58ac26b2..5ae2a59463 100644 --- a/src/wayland/appmenu_interface.h +++ b/src/wayland/appmenu_interface.h @@ -60,7 +60,8 @@ public: /** * Structure containing DBus service name and path */ - struct InterfaceAddress { + struct InterfaceAddress + { /** Service name of host with the AppMenu object*/ QString serviceName; /** Object path of the AppMenu interface*/ diff --git a/src/wayland/autotests/client/test_drag_drop.cpp b/src/wayland/autotests/client/test_drag_drop.cpp index 301c7912af..5e647e54d8 100644 --- a/src/wayland/autotests/client/test_drag_drop.cpp +++ b/src/wayland/autotests/client/test_drag_drop.cpp @@ -109,9 +109,9 @@ void TestDragAndDrop::init() m_registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); -#define CREATE(variable, factory, iface) \ - variable = \ - m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ +#define CREATE(variable, factory, iface) \ + variable = \ + m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ QVERIFY(variable); CREATE(m_compositor, Compositor, Compositor) @@ -137,10 +137,10 @@ void TestDragAndDrop::init() void TestDragAndDrop::cleanup() { -#define DELETE(name) \ - if (name) { \ - delete name; \ - name = nullptr; \ +#define DELETE(name) \ + if (name) { \ + delete name; \ + name = nullptr; \ } DELETE(m_dataSource) DELETE(m_dataDevice) diff --git a/src/wayland/autotests/client/test_error.cpp b/src/wayland/autotests/client/test_error.cpp index cee0b0b4cd..4a697bc979 100644 --- a/src/wayland/autotests/client/test_error.cpp +++ b/src/wayland/autotests/client/test_error.cpp @@ -93,10 +93,10 @@ void ErrorTest::init() void ErrorTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_plasmaShell) CLEANUP(m_compositor) diff --git a/src/wayland/autotests/client/test_fake_input.cpp b/src/wayland/autotests/client/test_fake_input.cpp index c94bdb0856..e68a810777 100644 --- a/src/wayland/autotests/client/test_fake_input.cpp +++ b/src/wayland/autotests/client/test_fake_input.cpp @@ -101,10 +101,10 @@ void FakeInputTest::init() void FakeInputTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_fakeInput) CLEANUP(m_queue) diff --git a/src/wayland/autotests/client/test_idle.cpp b/src/wayland/autotests/client/test_idle.cpp index 8b68021b08..216a9c56e3 100644 --- a/src/wayland/autotests/client/test_idle.cpp +++ b/src/wayland/autotests/client/test_idle.cpp @@ -90,10 +90,10 @@ void IdleTest::init() void IdleTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_idle) CLEANUP(m_seat) diff --git a/src/wayland/autotests/client/test_plasma_activities.cpp b/src/wayland/autotests/client/test_plasma_activities.cpp index 321e32f550..13f398ae16 100644 --- a/src/wayland/autotests/client/test_plasma_activities.cpp +++ b/src/wayland/autotests/client/test_plasma_activities.cpp @@ -120,10 +120,10 @@ void TestActivities::init() void TestActivities::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_windowInterface) diff --git a/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp b/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp index f8fb3488e4..4c4d3518c2 100644 --- a/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp +++ b/src/wayland/autotests/client/test_plasma_virtual_desktop.cpp @@ -144,10 +144,10 @@ void TestVirtualDesktop::init() void TestVirtualDesktop::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_plasmaVirtualDesktopManagement) diff --git a/src/wayland/autotests/client/test_plasmashell.cpp b/src/wayland/autotests/client/test_plasmashell.cpp index f2602b6913..c015d4c0a3 100644 --- a/src/wayland/autotests/client/test_plasmashell.cpp +++ b/src/wayland/autotests/client/test_plasmashell.cpp @@ -96,9 +96,9 @@ void TestPlasmaShell::init() m_registry->setup(); QVERIFY(interfacesAnnouncedSpy.wait()); -#define CREATE(variable, factory, iface) \ - variable = \ - m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ +#define CREATE(variable, factory, iface) \ + variable = \ + m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ QVERIFY(variable); CREATE(m_compositor, Compositor, Compositor) @@ -109,10 +109,10 @@ void TestPlasmaShell::init() void TestPlasmaShell::cleanup() { -#define DELETE(name) \ - if (name) { \ - delete name; \ - name = nullptr; \ +#define DELETE(name) \ + if (name) { \ + delete name; \ + name = nullptr; \ } DELETE(m_plasmaShell) DELETE(m_compositor) diff --git a/src/wayland/autotests/client/test_pointer_constraints.cpp b/src/wayland/autotests/client/test_pointer_constraints.cpp index c727b2b0fd..010a1b2752 100644 --- a/src/wayland/autotests/client/test_pointer_constraints.cpp +++ b/src/wayland/autotests/client/test_pointer_constraints.cpp @@ -122,10 +122,10 @@ void TestPointerConstraints::init() void TestPointerConstraints::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_pointerConstraints) diff --git a/src/wayland/autotests/client/test_selection.cpp b/src/wayland/autotests/client/test_selection.cpp index 44a8240226..13a6715595 100644 --- a/src/wayland/autotests/client/test_selection.cpp +++ b/src/wayland/autotests/client/test_selection.cpp @@ -39,7 +39,8 @@ private: SeatInterface *m_seatInterface = nullptr; DataDeviceManagerInterface *m_ddmInterface = nullptr; - struct Connection { + struct Connection + { ConnectionThread *connection = nullptr; QThread *thread = nullptr; EventQueue *queue = nullptr; @@ -153,8 +154,8 @@ void SelectionTest::cleanup() { cleanupConnection(&m_client1); cleanupConnection(&m_client2); -#define CLEANUP(variable) \ - delete variable; \ +#define CLEANUP(variable) \ + delete variable; \ variable = nullptr; CLEANUP(m_display) diff --git a/src/wayland/autotests/client/test_server_side_decoration_palette.cpp b/src/wayland/autotests/client/test_server_side_decoration_palette.cpp index b378ea67e3..839f147a71 100644 --- a/src/wayland/autotests/client/test_server_side_decoration_palette.cpp +++ b/src/wayland/autotests/client/test_server_side_decoration_palette.cpp @@ -109,10 +109,10 @@ void TestServerSideDecorationPalette::init() void TestServerSideDecorationPalette::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_paletteManager) diff --git a/src/wayland/autotests/client/test_shadow.cpp b/src/wayland/autotests/client/test_shadow.cpp index ca521ef9f6..0f03ae16ee 100644 --- a/src/wayland/autotests/client/test_shadow.cpp +++ b/src/wayland/autotests/client/test_shadow.cpp @@ -96,10 +96,10 @@ void ShadowTest::init() void ShadowTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_shm) CLEANUP(m_compositor) diff --git a/src/wayland/autotests/client/test_text_input_v2.cpp b/src/wayland/autotests/client/test_text_input_v2.cpp index 88beddda93..5b26ef95ab 100644 --- a/src/wayland/autotests/client/test_text_input_v2.cpp +++ b/src/wayland/autotests/client/test_text_input_v2.cpp @@ -127,10 +127,10 @@ void TextInputTest::init() void TextInputTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_textInputManagerV2) CLEANUP(m_keyboard) diff --git a/src/wayland/autotests/client/test_wayland_appmenu.cpp b/src/wayland/autotests/client/test_wayland_appmenu.cpp index debf0493b4..11e450f368 100644 --- a/src/wayland/autotests/client/test_wayland_appmenu.cpp +++ b/src/wayland/autotests/client/test_wayland_appmenu.cpp @@ -111,10 +111,10 @@ void TestAppmenu::init() void TestAppmenu::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_appmenuManager) diff --git a/src/wayland/autotests/client/test_wayland_blur.cpp b/src/wayland/autotests/client/test_wayland_blur.cpp index dbfef11be4..dfcd0a00c9 100644 --- a/src/wayland/autotests/client/test_wayland_blur.cpp +++ b/src/wayland/autotests/client/test_wayland_blur.cpp @@ -107,10 +107,10 @@ void TestBlur::init() void TestBlur::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_blurManager) diff --git a/src/wayland/autotests/client/test_wayland_contrast.cpp b/src/wayland/autotests/client/test_wayland_contrast.cpp index 94d4277cbd..ea63e2dc7d 100644 --- a/src/wayland/autotests/client/test_wayland_contrast.cpp +++ b/src/wayland/autotests/client/test_wayland_contrast.cpp @@ -110,10 +110,10 @@ void TestContrast::init() void TestContrast::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_contrastManager) diff --git a/src/wayland/autotests/client/test_wayland_seat.cpp b/src/wayland/autotests/client/test_wayland_seat.cpp index d2e464195f..a7fc4f1fbe 100644 --- a/src/wayland/autotests/client/test_wayland_seat.cpp +++ b/src/wayland/autotests/client/test_wayland_seat.cpp @@ -1092,15 +1092,15 @@ class PointerHoldGesture : public QObject, public QtWayland::zwp_pointer_gesture Q_OBJECT void zwp_pointer_gesture_hold_v1_begin(uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) override { - Q_EMIT started(serial, time, surface, fingers); + Q_EMIT started(serial, time, surface, fingers); } void zwp_pointer_gesture_hold_v1_end(uint32_t serial, uint32_t time, int32_t cancelled) override { - cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time); + cancelled ? Q_EMIT this->cancelled(serial, time) : Q_EMIT ended(serial, time); } Q_SIGNALS: - void started(quint32 serial , quint32 time, void *surface, quint32 fingers); + void started(quint32 serial, quint32 time, void *surface, quint32 fingers); void ended(quint32 serial, quint32 time); void cancelled(quint32 serial, quint32 time); }; @@ -1126,7 +1126,6 @@ void TestWaylandSeat::testPointerHoldGesture() PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer)); QVERIFY(gesture.isInitialized()); - QSignalSpy startSpy(&gesture, &PointerHoldGesture::started); QVERIFY(startSpy.isValid()); QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended); @@ -1139,7 +1138,7 @@ void TestWaylandSeat::testPointerHoldGesture() QVERIFY(surfaceCreatedSpy.isValid()); QScopedPointer surface(m_compositor->createSurface()); QVERIFY(surfaceCreatedSpy.wait()); - auto serverSurface = surfaceCreatedSpy.first().first().value(); + auto serverSurface = surfaceCreatedSpy.first().first().value(); QVERIFY(serverSurface); QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); @@ -1162,7 +1161,7 @@ void TestWaylandSeat::testPointerHoldGesture() QCOMPARE(startSpy.count(), 1); QCOMPARE(startSpy.first().at(0).value(), m_display->serial()); QCOMPARE(startSpy.first().at(1).value(), 1u); - QCOMPARE(startSpy.first().at(2).value(), *surface.get()); + QCOMPARE(startSpy.first().at(2).value(), *surface.get()); QCOMPARE(startSpy.first().at(3).value(), 3); // another start should not be possible diff --git a/src/wayland/autotests/client/test_wayland_slide.cpp b/src/wayland/autotests/client/test_wayland_slide.cpp index 3b8a42f236..81e79d0b5d 100644 --- a/src/wayland/autotests/client/test_wayland_slide.cpp +++ b/src/wayland/autotests/client/test_wayland_slide.cpp @@ -107,10 +107,10 @@ void TestSlide::init() void TestSlide::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) CLEANUP(m_slideManager) diff --git a/src/wayland/autotests/client/test_xdg_foreign.cpp b/src/wayland/autotests/client/test_xdg_foreign.cpp index d6a6e8b81b..759559af0c 100644 --- a/src/wayland/autotests/client/test_xdg_foreign.cpp +++ b/src/wayland/autotests/client/test_xdg_foreign.cpp @@ -140,10 +140,10 @@ void TestForeign::init() void TestForeign::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_compositor) diff --git a/src/wayland/autotests/client/test_xdg_shell.cpp b/src/wayland/autotests/client/test_xdg_shell.cpp index 130f8ea8d8..a436b984ff 100644 --- a/src/wayland/autotests/client/test_xdg_shell.cpp +++ b/src/wayland/autotests/client/test_xdg_shell.cpp @@ -75,14 +75,14 @@ private: Seat *m_seat = nullptr; }; -#define SURFACE \ - QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \ - QVERIFY(xdgSurfaceCreatedSpy.isValid()); \ - QScopedPointer surface(m_compositor->createSurface()); \ - QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); \ - QCOMPARE(xdgSurface->size(), QSize()); \ - QVERIFY(xdgSurfaceCreatedSpy.wait()); \ - auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value(); \ +#define SURFACE \ + QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \ + QVERIFY(xdgSurfaceCreatedSpy.isValid()); \ + QScopedPointer surface(m_compositor->createSurface()); \ + QScopedPointer xdgSurface(m_xdgShell->createSurface(surface.data())); \ + QCOMPARE(xdgSurface->size(), QSize()); \ + QVERIFY(xdgSurfaceCreatedSpy.wait()); \ + auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value(); \ QVERIFY(serverXdgToplevel); void XdgShellTest::init() @@ -164,10 +164,10 @@ void XdgShellTest::init() void XdgShellTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_xdgShell) CLEANUP(m_compositor) diff --git a/src/wayland/autotests/server/test_datacontrol_interface.cpp b/src/wayland/autotests/server/test_datacontrol_interface.cpp index 98af4617cc..71b0ecce04 100644 --- a/src/wayland/autotests/server/test_datacontrol_interface.cpp +++ b/src/wayland/autotests/server/test_datacontrol_interface.cpp @@ -219,10 +219,10 @@ void DataControlInterfaceTest::init() void DataControlInterfaceTest::cleanup() { -#define CLEANUP(variable) \ - if (variable) { \ - delete variable; \ - variable = nullptr; \ +#define CLEANUP(variable) \ + if (variable) { \ + delete variable; \ + variable = nullptr; \ } CLEANUP(m_dataControlDeviceManager) CLEANUP(m_clientSeat) diff --git a/src/wayland/datadevice_interface_p.h b/src/wayland/datadevice_interface_p.h index e70b8f6851..bc6c301403 100644 --- a/src/wayland/datadevice_interface_p.h +++ b/src/wayland/datadevice_interface_p.h @@ -35,7 +35,8 @@ public: QPointer selection; QPointer proxyRemoteSurface; - struct Drag { + struct Drag + { SurfaceInterface *surface = nullptr; QMetaObject::Connection destroyConnection; QMetaObject::Connection posConnection; diff --git a/src/wayland/display.cpp b/src/wayland/display.cpp index e27b8c8672..2b4006220d 100644 --- a/src/wayland/display.cpp +++ b/src/wayland/display.cpp @@ -157,7 +157,7 @@ QList Display::outputs() const return d->outputs; } -QList< OutputDeviceV2Interface* > Display::outputDevices() const +QList Display::outputDevices() const { return d->outputdevicesV2; } @@ -233,7 +233,8 @@ void *Display::eglDisplay() const return d->eglDisplay; } -struct ClientBufferDestroyListener : wl_listener { +struct ClientBufferDestroyListener : wl_listener +{ ClientBufferDestroyListener(Display *display, ClientBuffer *buffer); ~ClientBufferDestroyListener(); diff --git a/src/wayland/display.h b/src/wayland/display.h index 75cc4d6526..c90cc5bf08 100644 --- a/src/wayland/display.h +++ b/src/wayland/display.h @@ -111,7 +111,7 @@ public: /** * @returns All SeatInterface currently managed on the Display. */ - QVector seats() const; + QVector seats() const; QList outputDevices() const; QList outputs() const; QVector outputsIntersecting(const QRect &rect) const; diff --git a/src/wayland/drmleasedevice_v1_interface.cpp b/src/wayland/drmleasedevice_v1_interface.cpp index 7e33802214..27837b08ab 100644 --- a/src/wayland/drmleasedevice_v1_interface.cpp +++ b/src/wayland/drmleasedevice_v1_interface.cpp @@ -5,8 +5,8 @@ */ #include "drmleasedevice_v1_interface.h" -#include "drmleasedevice_v1_interface_p.h" #include "display.h" +#include "drmleasedevice_v1_interface_p.h" #include "logging.h" #include "utils.h" @@ -60,7 +60,6 @@ void DrmLeaseDeviceV1Interface::setDrmMaster(bool hasDrmMaster) d->hasDrmMaster = hasDrmMaster; } - DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function createNonMasterFd) : QtWaylandServer::wp_drm_lease_device_v1(*display, s_version) , q(device) @@ -165,7 +164,6 @@ void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_destroy_global() delete this; } - DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, uint32_t id, const QString &name, @@ -186,7 +184,7 @@ DrmLeaseConnectorV1Interface::~DrmLeaseConnectorV1Interface() DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource) { - if (auto connectorPrivate = resource_cast(resource)) { + if (auto connectorPrivate = resource_cast(resource)) { return connectorPrivate->q; } return nullptr; @@ -239,7 +237,6 @@ void DrmLeaseConnectorV1InterfacePrivate::wp_drm_lease_connector_v1_destroy(Reso wl_resource_destroy(resource->handle); } - DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource) : wp_drm_lease_request_v1(resource) , device(device) @@ -363,7 +360,6 @@ QVector DrmLeaseV1Interface::connectors() const return d->connectors; } - DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource) : wp_drm_lease_v1(resource) , device(device) diff --git a/src/wayland/drmleasedevice_v1_interface_p.h b/src/wayland/drmleasedevice_v1_interface_p.h index 085aac8573..6f499f771f 100644 --- a/src/wayland/drmleasedevice_v1_interface_p.h +++ b/src/wayland/drmleasedevice_v1_interface_p.h @@ -40,6 +40,7 @@ public: std::function createNonMasterFd; bool hasDrmMaster = true; bool removed = false; + protected: void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override; void wp_drm_lease_device_v1_release(Resource *resource) override; @@ -66,6 +67,7 @@ public: QString name; QString description; bool withdrawn = false; + protected: void wp_drm_lease_connector_v1_destroy(Resource *resource) override; }; @@ -79,6 +81,7 @@ public: DrmLeaseDeviceV1InterfacePrivate *device; QVector connectors; bool invalid = false; + protected: void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector) override; void wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) override; @@ -95,10 +98,10 @@ public: QVector connectors; uint32_t lesseeId = 0; bool finished = false; + protected: void wp_drm_lease_v1_destroy(Resource *resource) override; void wp_drm_lease_v1_destroy_resource(Resource *resource) override; }; } - diff --git a/src/wayland/keyboard_interface.cpp b/src/wayland/keyboard_interface.cpp index 4419dc1d7c..4ccf7f4d38 100644 --- a/src/wayland/keyboard_interface.cpp +++ b/src/wayland/keyboard_interface.cpp @@ -201,10 +201,10 @@ void KeyboardInterface::sendKey(quint32 key, KeyboardKeyState state) void KeyboardInterface::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) { bool changed = false; -#define UPDATE(value) \ - if (d->modifiers.value != value) { \ - d->modifiers.value = value; \ - changed = true; \ +#define UPDATE(value) \ + if (d->modifiers.value != value) { \ + d->modifiers.value = value; \ + changed = true; \ } UPDATE(depressed) UPDATE(latched) diff --git a/src/wayland/keyboard_interface_p.h b/src/wayland/keyboard_interface_p.h index 98ba3f7540..46b3fc946f 100644 --- a/src/wayland/keyboard_interface_p.h +++ b/src/wayland/keyboard_interface_p.h @@ -39,12 +39,14 @@ public: QMetaObject::Connection destroyConnection; QByteArray keymap; - struct { + struct + { qint32 charactersPerSecond = 0; qint32 delay = 0; } keyRepeat; - struct Modifiers { + struct Modifiers + { quint32 depressed = 0; quint32 latched = 0; quint32 locked = 0; diff --git a/src/wayland/layershell_v1_interface.h b/src/wayland/layershell_v1_interface.h index 53b52a66a8..4d20336c90 100644 --- a/src/wayland/layershell_v1_interface.h +++ b/src/wayland/layershell_v1_interface.h @@ -59,7 +59,12 @@ class KWAYLANDSERVER_EXPORT LayerSurfaceV1Interface : public QObject Q_OBJECT public: - enum Layer { BackgroundLayer, BottomLayer, TopLayer, OverlayLayer }; + enum Layer { + BackgroundLayer, + BottomLayer, + TopLayer, + OverlayLayer, + }; LayerSurfaceV1Interface(LayerShellV1Interface *shell, SurfaceInterface *surface, diff --git a/src/wayland/linuxdmabufv1clientbuffer.cpp b/src/wayland/linuxdmabufv1clientbuffer.cpp index 20a2d13f04..f04f9ba6b3 100644 --- a/src/wayland/linuxdmabufv1clientbuffer.cpp +++ b/src/wayland/linuxdmabufv1clientbuffer.cpp @@ -16,8 +16,8 @@ #include "surface_interface_p.h" #include -#include #include +#include #include namespace KWaylandServer @@ -508,7 +508,8 @@ void LinuxDmaBufV1FeedbackPrivate::zwp_linux_dmabuf_feedback_v1_destroy(Resource wl_resource_destroy(resource->handle); } -struct linux_dmabuf_feedback_v1_table_entry { +struct linux_dmabuf_feedback_v1_table_entry +{ uint32_t format; uint32_t pad; // unused uint64_t modifier; diff --git a/src/wayland/linuxdmabufv1clientbuffer.h b/src/wayland/linuxdmabufv1clientbuffer.h index 13f161ac37..0c40e53ea2 100644 --- a/src/wayland/linuxdmabufv1clientbuffer.h +++ b/src/wayland/linuxdmabufv1clientbuffer.h @@ -24,7 +24,8 @@ class LinuxDmaBufV1FeedbackPrivate; /** * The LinuxDmaBufV1Plane type represents a plane in a client buffer. */ -struct LinuxDmaBufV1Plane { +struct LinuxDmaBufV1Plane +{ int fd = -1; ///< The dmabuf file descriptor quint32 offset = 0; ///< The offset from the start of buffer quint32 stride = 0; ///< The distance from the start of a row to the next row in bytes @@ -70,7 +71,8 @@ public: }; Q_DECLARE_FLAGS(TrancheFlags, TrancheFlag) - struct Tranche { + struct Tranche + { dev_t device; TrancheFlags flags; QHash> formatTable; diff --git a/src/wayland/output_interface.cpp b/src/wayland/output_interface.cpp index b5ac1bbcc2..05c6b2ca41 100644 --- a/src/wayland/output_interface.cpp +++ b/src/wayland/output_interface.cpp @@ -40,7 +40,8 @@ public: OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown; OutputInterface::Transform transform = OutputInterface::Transform::Normal; OutputInterface::Mode mode; - struct { + struct + { OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off; bool supported = false; } dpms; diff --git a/src/wayland/output_interface.h b/src/wayland/output_interface.h index 4cf1ccdbe9..6afb62d294 100644 --- a/src/wayland/output_interface.h +++ b/src/wayland/output_interface.h @@ -54,7 +54,8 @@ public: Flipped180, Flipped270, }; - struct Mode { + struct Mode + { QSize size = QSize(); int refreshRate = 60000; }; diff --git a/src/wayland/outputchangeset_v2.h b/src/wayland/outputchangeset_v2.h index 07292e0828..31b1953f84 100644 --- a/src/wayland/outputchangeset_v2.h +++ b/src/wayland/outputchangeset_v2.h @@ -40,7 +40,7 @@ public: * @returns @c true if the enabled property of the outputdevice has changed. * bool modeChanged() const; */ - /** Whether the transform() property of the outputdevice changed. */ + /** Whether the transform() property of the outputdevice changed. */ bool transformChanged() const; /** Whether the size property of the outputdevice changed. diff --git a/src/wayland/outputconfiguration_v2_interface.cpp b/src/wayland/outputconfiguration_v2_interface.cpp index ea83f492bc..0d08d685ab 100644 --- a/src/wayland/outputconfiguration_v2_interface.cpp +++ b/src/wayland/outputconfiguration_v2_interface.cpp @@ -5,14 +5,14 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#include "display.h" #include "outputconfiguration_v2_interface.h" -#include "outputdevice_v2_interface.h" +#include "display.h" #include "logging.h" #include "outputchangeset_v2_p.h" +#include "outputdevice_v2_interface.h" -#include "qwayland-server-kde-output-management-v2.h" #include "qwayland-server-kde-output-device-v2.h" +#include "qwayland-server-kde-output-management-v2.h" #include @@ -56,7 +56,7 @@ protected: void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) { Q_UNUSED(resource) - + OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); pendingChanges(output)->d->enabled = enable == 1; } @@ -76,23 +76,23 @@ void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_transfor Q_UNUSED(resource) auto toTransform = [transform]() { switch (transform) { - case WL_OUTPUT_TRANSFORM_90: - return OutputDeviceV2Interface::Transform::Rotated90; - case WL_OUTPUT_TRANSFORM_180: - return OutputDeviceV2Interface::Transform::Rotated180; - case WL_OUTPUT_TRANSFORM_270: - return OutputDeviceV2Interface::Transform::Rotated270; - case WL_OUTPUT_TRANSFORM_FLIPPED: - return OutputDeviceV2Interface::Transform::Flipped; - case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return OutputDeviceV2Interface::Transform::Flipped90; - case WL_OUTPUT_TRANSFORM_FLIPPED_180: - return OutputDeviceV2Interface::Transform::Flipped180; - case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return OutputDeviceV2Interface::Transform::Flipped270; - case WL_OUTPUT_TRANSFORM_NORMAL: - default: - return OutputDeviceV2Interface::Transform::Normal; + case WL_OUTPUT_TRANSFORM_90: + return OutputDeviceV2Interface::Transform::Rotated90; + case WL_OUTPUT_TRANSFORM_180: + return OutputDeviceV2Interface::Transform::Rotated180; + case WL_OUTPUT_TRANSFORM_270: + return OutputDeviceV2Interface::Transform::Rotated270; + case WL_OUTPUT_TRANSFORM_FLIPPED: + return OutputDeviceV2Interface::Transform::Flipped; + case WL_OUTPUT_TRANSFORM_FLIPPED_90: + return OutputDeviceV2Interface::Transform::Flipped90; + case WL_OUTPUT_TRANSFORM_FLIPPED_180: + return OutputDeviceV2Interface::Transform::Flipped180; + case WL_OUTPUT_TRANSFORM_FLIPPED_270: + return OutputDeviceV2Interface::Transform::Flipped270; + case WL_OUTPUT_TRANSFORM_NORMAL: + default: + return OutputDeviceV2Interface::Transform::Normal; } }; auto _transform = toTransform(); @@ -118,7 +118,7 @@ void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_scale(Re return; } OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); - + pendingChanges(output)->d->scale = doubleScale; } @@ -190,7 +190,7 @@ OutputConfigurationV2InterfacePrivate::OutputConfigurationV2InterfacePrivate(Out { } -QHash OutputConfigurationV2Interface::changes() const +QHash OutputConfigurationV2Interface::changes() const { return d->changes; } @@ -244,12 +244,7 @@ bool OutputConfigurationV2InterfacePrivate::hasPendingChanges(OutputDeviceV2Inte return false; } auto c = *it; - return c->enabledChanged() || - c->sizeChanged() || - c->refreshRateChanged() || - c->transformChanged() || - c->positionChanged() || - c->scaleChanged(); + return c->enabledChanged() || c->sizeChanged() || c->refreshRateChanged() || c->transformChanged() || c->positionChanged() || c->scaleChanged(); } void OutputConfigurationV2InterfacePrivate::clearPendingChanges() diff --git a/src/wayland/outputconfiguration_v2_interface.h b/src/wayland/outputconfiguration_v2_interface.h index d3d300f63e..5749edb1c5 100644 --- a/src/wayland/outputconfiguration_v2_interface.h +++ b/src/wayland/outputconfiguration_v2_interface.h @@ -6,9 +6,9 @@ */ #pragma once -#include "outputmanagement_v2_interface.h" -#include "outputdevice_v2_interface.h" #include "outputchangeset_v2.h" +#include "outputdevice_v2_interface.h" +#include "outputmanagement_v2_interface.h" #include @@ -88,7 +88,6 @@ private: QScopedPointer d; }; - } -Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface*) +Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface *) diff --git a/src/wayland/outputdevice_v2_interface.cpp b/src/wayland/outputdevice_v2_interface.cpp index 400ec9ccc7..400cd64cbf 100644 --- a/src/wayland/outputdevice_v2_interface.cpp +++ b/src/wayland/outputdevice_v2_interface.cpp @@ -6,14 +6,14 @@ */ #include "outputdevice_v2_interface.h" -#include "display_p.h" #include "display.h" +#include "display_p.h" #include "logging.h" #include "utils.h" #include -#include #include +#include #include @@ -84,7 +84,8 @@ protected: class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2 { public: - struct ModeResource : Resource { + struct ModeResource : Resource + { OutputDeviceV2InterfacePrivate::Resource *output; }; @@ -96,7 +97,10 @@ public: void bindResource(wl_resource *resource); - static OutputDeviceModeV2InterfacePrivate *get(OutputDeviceModeV2Interface *mode) { return mode->d.data(); } + static OutputDeviceModeV2InterfacePrivate *get(OutputDeviceModeV2Interface *mode) + { + return mode->d.data(); + } OutputDeviceModeV2Interface *q; @@ -174,7 +178,7 @@ void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode) } if (d->currentMode) { // another mode has the current flag - remove - d->currentMode->setFlags(d->currentMode->flags() & ~uint(OutputDeviceModeV2Interface::ModeFlag::Current)); + d->currentMode->setFlags(d->currentMode->flags() & ~uint(OutputDeviceModeV2Interface::ModeFlag::Current)); } mode->setFlags(mode->flags() | OutputDeviceModeV2Interface::ModeFlag::Current); @@ -191,11 +195,9 @@ void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode) bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate) { - auto mode = std::find_if(d->modes.begin(), d->modes.end(), - [size, refreshRate](OutputDeviceModeV2Interface *mode) { - return mode->size() == size && mode->refreshRate() == refreshRate; - } - ); + auto mode = std::find_if(d->modes.begin(), d->modes.end(), [size, refreshRate](OutputDeviceModeV2Interface *mode) { + return mode->size() == size && mode->refreshRate() == refreshRate; + }); if (mode == d->modes.end()) { return false; } @@ -296,14 +298,14 @@ void OutputDeviceV2InterfacePrivate::sendCurrentMode(Resource *outputResource) void OutputDeviceV2InterfacePrivate::sendGeometry(Resource *resource) { send_geometry(resource->handle, - globalPosition.x(), - globalPosition.y(), - physicalSize.width(), - physicalSize.height(), - toSubPixel(), - manufacturer, - model, - toTransform()); + globalPosition.x(), + globalPosition.y(), + physicalSize.width(), + physicalSize.height(), + toSubPixel(), + manufacturer, + model, + toTransform()); } void OutputDeviceV2InterfacePrivate::sendScale(Resource *resource) @@ -692,12 +694,14 @@ OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDev , m_size(size) , m_refreshRate(refreshRate) , m_flags(flags) -{} +{ +} OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent) : QObject(parent) , d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags)) -{} +{ +} OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default; diff --git a/src/wayland/outputdevice_v2_interface.h b/src/wayland/outputdevice_v2_interface.h index e08f7333af..26c609cdb3 100644 --- a/src/wayland/outputdevice_v2_interface.h +++ b/src/wayland/outputdevice_v2_interface.h @@ -24,7 +24,6 @@ class OutputDeviceV2InterfacePrivate; class OutputDeviceModeV2Interface; class OutputDeviceModeV2InterfacePrivate; - /** @class OutputDeviceV2Interface * * Represents an output device, the difference to Output is that this output can be disabled, @@ -146,7 +145,7 @@ private: * * Represents an output device mode. * -* @see OutputDeviceV2Interface + * @see OutputDeviceV2Interface */ class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject { diff --git a/src/wayland/outputmanagement_v2_interface.cpp b/src/wayland/outputmanagement_v2_interface.cpp index 8194d66cd5..aeb809625d 100644 --- a/src/wayland/outputmanagement_v2_interface.cpp +++ b/src/wayland/outputmanagement_v2_interface.cpp @@ -4,12 +4,12 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -#include "display.h" #include "outputmanagement_v2_interface.h" +#include "display.h" #include "outputconfiguration_v2_interface.h" -#include #include "qwayland-server-kde-output-management-v2.h" +#include #include diff --git a/src/wayland/seat_interface.h b/src/wayland/seat_interface.h index 00d35e71ef..7ffd8fc858 100644 --- a/src/wayland/seat_interface.h +++ b/src/wayland/seat_interface.h @@ -538,7 +538,6 @@ public: */ void startPointerHoldGesture(quint32 fingerCount); - /** * The multi-finger hold gesture ended. This may happen when one or more fingers are lifted. * @see startPointerHoldGesture diff --git a/src/wayland/seat_interface_p.h b/src/wayland/seat_interface_p.h index a4b2337fd8..2d5bb4d14e 100644 --- a/src/wayland/seat_interface_p.h +++ b/src/wayland/seat_interface_p.h @@ -69,7 +69,8 @@ public: AbstractDataSource *currentPrimarySelection = nullptr; // Pointer related members - struct Pointer { + struct Pointer + { enum class State { Released, Pressed, @@ -77,7 +78,8 @@ public: QHash buttonSerials; QHash buttonStates; QPointF pos; - struct Focus { + struct Focus + { SurfaceInterface *surface = nullptr; QMetaObject::Connection destroyConnection; QPointF offset = QPointF(); @@ -91,8 +93,10 @@ public: void updatePointerButtonState(quint32 button, Pointer::State state); // Keyboard related members - struct Keyboard { - struct Focus { + struct Keyboard + { + struct Focus + { SurfaceInterface *surface = nullptr; QMetaObject::Connection destroyConnection; quint32 serial = 0; @@ -104,8 +108,10 @@ public: Keyboard globalKeyboard; // Touch related members - struct Touch { - struct Focus { + struct Touch + { + struct Focus + { SurfaceInterface *surface = nullptr; QMetaObject::Connection destroyConnection; QPointF offset = QPointF(); @@ -117,7 +123,8 @@ public: }; Touch globalTouch; - struct Drag { + struct Drag + { enum class Mode { None, Pointer, diff --git a/src/wayland/shadow_interface.cpp b/src/wayland/shadow_interface.cpp index 76b037011f..1c3a162415 100644 --- a/src/wayland/shadow_interface.cpp +++ b/src/wayland/shadow_interface.cpp @@ -91,7 +91,8 @@ public: ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource); ~ShadowInterfacePrivate(); - struct State { + struct State + { enum Flags { None = 0, LeftBuffer = 1 << 0, @@ -145,15 +146,15 @@ protected: void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource) { Q_UNUSED(resource) -#define BUFFER(__FLAG__, __PART__) \ - if (pending.flags & State::Flags::__FLAG__##Buffer) { \ - if (current.__PART__) { \ - current.__PART__->unref(); \ - } \ - if (pending.__PART__) { \ - pending.__PART__->ref(); \ - } \ - current.__PART__ = pending.__PART__; \ +#define BUFFER(__FLAG__, __PART__) \ + if (pending.flags & State::Flags::__FLAG__##Buffer) { \ + if (current.__PART__) { \ + current.__PART__->unref(); \ + } \ + if (pending.__PART__) { \ + pending.__PART__->ref(); \ + } \ + current.__PART__ = pending.__PART__; \ } BUFFER(Left, left) BUFFER(TopLeft, topLeft) @@ -301,9 +302,9 @@ ShadowInterfacePrivate::ShadowInterfacePrivate(ShadowInterface *_q, wl_resource ShadowInterfacePrivate::~ShadowInterfacePrivate() { -#define CURRENT(__PART__) \ - if (current.__PART__) { \ - current.__PART__->unref(); \ +#define CURRENT(__PART__) \ + if (current.__PART__) { \ + current.__PART__->unref(); \ } CURRENT(left) CURRENT(topLeft) @@ -330,10 +331,10 @@ QMarginsF ShadowInterface::offset() const return d->current.offset; } -#define BUFFER(__PART__) \ - ClientBuffer *ShadowInterface::__PART__() const \ - { \ - return d->current.__PART__; \ +#define BUFFER(__PART__) \ + ClientBuffer *ShadowInterface::__PART__() const \ + { \ + return d->current.__PART__; \ } BUFFER(left) diff --git a/src/wayland/shmclientbuffer.cpp b/src/wayland/shmclientbuffer.cpp index fd4fe527d8..b9cefced2d 100644 --- a/src/wayland/shmclientbuffer.cpp +++ b/src/wayland/shmclientbuffer.cpp @@ -30,7 +30,8 @@ public: bool hasAlphaChannel = false; QImage savedData; - struct DestroyListener { + struct DestroyListener + { wl_listener listener; ShmClientBufferPrivate *receiver; }; diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index 34538532c0..781b4a4ba6 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -38,16 +38,13 @@ SurfaceInterfacePrivate::~SurfaceInterfacePrivate() wl_resource *resource; wl_resource *tmp; - wl_resource_for_each_safe(resource, tmp, ¤t.frameCallbacks) - { + wl_resource_for_each_safe (resource, tmp, ¤t.frameCallbacks) { wl_resource_destroy(resource); } - wl_resource_for_each_safe(resource, tmp, &pending.frameCallbacks) - { + wl_resource_for_each_safe (resource, tmp, &pending.frameCallbacks) { wl_resource_destroy(resource); } - wl_resource_for_each_safe(resource, tmp, &cached.frameCallbacks) - { + wl_resource_for_each_safe (resource, tmp, &cached.frameCallbacks) { wl_resource_destroy(resource); } @@ -368,8 +365,7 @@ void SurfaceInterface::frameRendered(quint32 msec) wl_resource *resource; wl_resource *tmp; - wl_resource_for_each_safe(resource, tmp, &d->current.frameCallbacks) - { + wl_resource_for_each_safe (resource, tmp, &d->current.frameCallbacks) { wl_callback_send_done(resource, msec); wl_resource_destroy(resource); } diff --git a/src/wayland/surface_interface_p.h b/src/wayland/surface_interface_p.h index 9b412baae8..5daa2a6312 100644 --- a/src/wayland/surface_interface_p.h +++ b/src/wayland/surface_interface_p.h @@ -20,7 +20,8 @@ class IdleInhibitorV1Interface; class SurfaceRole; class ViewportInterface; -struct SurfaceState { +struct SurfaceState +{ void mergeInto(SurfaceState *target); QRegion damage = QRegion(); @@ -53,7 +54,8 @@ struct SurfaceState { QList below; QList above; - struct { + struct + { QRectF sourceGeometry = QRectF(); QSize destinationSize = QSize(); bool sourceGeometryIsSet = false; diff --git a/src/wayland/tests/paneltest.cpp b/src/wayland/tests/paneltest.cpp index 7f4cca2d66..9de4da734e 100644 --- a/src/wayland/tests/paneltest.cpp +++ b/src/wayland/tests/paneltest.cpp @@ -59,7 +59,8 @@ private: PlasmaShell *m_plasmaShell = nullptr; PlasmaShellSurface *m_plasmaShellSurface = nullptr; PlasmaWindowManagement *m_windowManagement = nullptr; - struct { + struct + { Surface *surface = nullptr; ShellSurface *shellSurface = nullptr; PlasmaShellSurface *plasmaSurface = nullptr; diff --git a/src/wayland/textinput_v3_interface_p.h b/src/wayland/textinput_v3_interface_p.h index e3fa011d50..c404f33e10 100644 --- a/src/wayland/textinput_v3_interface_p.h +++ b/src/wayland/textinput_v3_interface_p.h @@ -63,7 +63,8 @@ public: qint32 surroundingTextSelectionAnchor = 0; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; - struct { + struct + { QRect cursorRectangle; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; TextInputContentHints contentHints = TextInputContentHint::None; diff --git a/src/wayland/utils.h b/src/wayland/utils.h index d4c7b00d05..ac0cd6e749 100644 --- a/src/wayland/utils.h +++ b/src/wayland/utils.h @@ -18,7 +18,8 @@ struct wl_resource; namespace KWaylandServer { template -struct SafeGlobalDeleter { +struct SafeGlobalDeleter +{ static inline void cleanup(T *global) { if (global) { diff --git a/src/wayland/xdgdecoration_v1_interface.h b/src/wayland/xdgdecoration_v1_interface.h index 0f87994da2..d5067c13a0 100644 --- a/src/wayland/xdgdecoration_v1_interface.h +++ b/src/wayland/xdgdecoration_v1_interface.h @@ -61,7 +61,12 @@ class KWAYLANDSERVER_EXPORT XdgToplevelDecorationV1Interface : public QObject Q_OBJECT public: - enum class Mode { Undefined, None, Client, Server }; + enum class Mode { + Undefined, + None, + Client, + Server, + }; Q_ENUM(Mode) /** diff --git a/src/wayland/xdgshell_interface_p.h b/src/wayland/xdgshell_interface_p.h index 0e3190fe2a..c8294a2bf6 100644 --- a/src/wayland/xdgshell_interface_p.h +++ b/src/wayland/xdgshell_interface_p.h @@ -83,7 +83,8 @@ protected: void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override; }; -struct XdgSurfaceState { +struct XdgSurfaceState +{ QRect windowGeometry; quint32 acknowledgedConfigure; bool acknowledgedConfigureIsSet = false; @@ -139,7 +140,8 @@ public: QString windowTitle; QString windowClass; - struct State { + struct State + { QSize minimumSize; QSize maximumSize; };