Run .clang-format

This commit is contained in:
Vlad Zahorodnii 2022-04-19 13:14:26 +03:00
parent 14ae6e3100
commit 227ab071be
50 changed files with 247 additions and 220 deletions

View file

@ -60,7 +60,8 @@ public:
/** /**
* Structure containing DBus service name and path * Structure containing DBus service name and path
*/ */
struct InterfaceAddress { struct InterfaceAddress
{
/** Service name of host with the AppMenu object*/ /** Service name of host with the AppMenu object*/
QString serviceName; QString serviceName;
/** Object path of the AppMenu interface*/ /** Object path of the AppMenu interface*/

View file

@ -109,9 +109,9 @@ void TestDragAndDrop::init()
m_registry->setup(); m_registry->setup();
QVERIFY(interfacesAnnouncedSpy.wait()); QVERIFY(interfacesAnnouncedSpy.wait());
#define CREATE(variable, factory, iface) \ #define CREATE(variable, factory, iface) \
variable = \ variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
QVERIFY(variable); QVERIFY(variable);
CREATE(m_compositor, Compositor, Compositor) CREATE(m_compositor, Compositor, Compositor)
@ -137,10 +137,10 @@ void TestDragAndDrop::init()
void TestDragAndDrop::cleanup() void TestDragAndDrop::cleanup()
{ {
#define DELETE(name) \ #define DELETE(name) \
if (name) { \ if (name) { \
delete name; \ delete name; \
name = nullptr; \ name = nullptr; \
} }
DELETE(m_dataSource) DELETE(m_dataSource)
DELETE(m_dataDevice) DELETE(m_dataDevice)

View file

@ -93,10 +93,10 @@ void ErrorTest::init()
void ErrorTest::cleanup() void ErrorTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_plasmaShell) CLEANUP(m_plasmaShell)
CLEANUP(m_compositor) CLEANUP(m_compositor)

View file

@ -101,10 +101,10 @@ void FakeInputTest::init()
void FakeInputTest::cleanup() void FakeInputTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_fakeInput) CLEANUP(m_fakeInput)
CLEANUP(m_queue) CLEANUP(m_queue)

View file

@ -90,10 +90,10 @@ void IdleTest::init()
void IdleTest::cleanup() void IdleTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_idle) CLEANUP(m_idle)
CLEANUP(m_seat) CLEANUP(m_seat)

View file

@ -120,10 +120,10 @@ void TestActivities::init()
void TestActivities::cleanup() void TestActivities::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_windowInterface) CLEANUP(m_windowInterface)

View file

@ -144,10 +144,10 @@ void TestVirtualDesktop::init()
void TestVirtualDesktop::cleanup() void TestVirtualDesktop::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_plasmaVirtualDesktopManagement) CLEANUP(m_plasmaVirtualDesktopManagement)

View file

@ -96,9 +96,9 @@ void TestPlasmaShell::init()
m_registry->setup(); m_registry->setup();
QVERIFY(interfacesAnnouncedSpy.wait()); QVERIFY(interfacesAnnouncedSpy.wait());
#define CREATE(variable, factory, iface) \ #define CREATE(variable, factory, iface) \
variable = \ variable = \
m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \ m_registry->create##factory(m_registry->interface(Registry::Interface::iface).name, m_registry->interface(Registry::Interface::iface).version, this); \
QVERIFY(variable); QVERIFY(variable);
CREATE(m_compositor, Compositor, Compositor) CREATE(m_compositor, Compositor, Compositor)
@ -109,10 +109,10 @@ void TestPlasmaShell::init()
void TestPlasmaShell::cleanup() void TestPlasmaShell::cleanup()
{ {
#define DELETE(name) \ #define DELETE(name) \
if (name) { \ if (name) { \
delete name; \ delete name; \
name = nullptr; \ name = nullptr; \
} }
DELETE(m_plasmaShell) DELETE(m_plasmaShell)
DELETE(m_compositor) DELETE(m_compositor)

View file

@ -122,10 +122,10 @@ void TestPointerConstraints::init()
void TestPointerConstraints::cleanup() void TestPointerConstraints::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_pointerConstraints) CLEANUP(m_pointerConstraints)

View file

@ -39,7 +39,8 @@ private:
SeatInterface *m_seatInterface = nullptr; SeatInterface *m_seatInterface = nullptr;
DataDeviceManagerInterface *m_ddmInterface = nullptr; DataDeviceManagerInterface *m_ddmInterface = nullptr;
struct Connection { struct Connection
{
ConnectionThread *connection = nullptr; ConnectionThread *connection = nullptr;
QThread *thread = nullptr; QThread *thread = nullptr;
EventQueue *queue = nullptr; EventQueue *queue = nullptr;
@ -153,8 +154,8 @@ void SelectionTest::cleanup()
{ {
cleanupConnection(&m_client1); cleanupConnection(&m_client1);
cleanupConnection(&m_client2); cleanupConnection(&m_client2);
#define CLEANUP(variable) \ #define CLEANUP(variable) \
delete variable; \ delete variable; \
variable = nullptr; variable = nullptr;
CLEANUP(m_display) CLEANUP(m_display)

View file

@ -109,10 +109,10 @@ void TestServerSideDecorationPalette::init()
void TestServerSideDecorationPalette::cleanup() void TestServerSideDecorationPalette::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_paletteManager) CLEANUP(m_paletteManager)

View file

@ -96,10 +96,10 @@ void ShadowTest::init()
void ShadowTest::cleanup() void ShadowTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_shm) CLEANUP(m_shm)
CLEANUP(m_compositor) CLEANUP(m_compositor)

View file

@ -127,10 +127,10 @@ void TextInputTest::init()
void TextInputTest::cleanup() void TextInputTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_textInputManagerV2) CLEANUP(m_textInputManagerV2)
CLEANUP(m_keyboard) CLEANUP(m_keyboard)

View file

@ -111,10 +111,10 @@ void TestAppmenu::init()
void TestAppmenu::cleanup() void TestAppmenu::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_appmenuManager) CLEANUP(m_appmenuManager)

View file

@ -107,10 +107,10 @@ void TestBlur::init()
void TestBlur::cleanup() void TestBlur::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_blurManager) CLEANUP(m_blurManager)

View file

@ -110,10 +110,10 @@ void TestContrast::init()
void TestContrast::cleanup() void TestContrast::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_contrastManager) CLEANUP(m_contrastManager)

View file

@ -1092,15 +1092,15 @@ class PointerHoldGesture : public QObject, public QtWayland::zwp_pointer_gesture
Q_OBJECT Q_OBJECT
void zwp_pointer_gesture_hold_v1_begin(uint32_t serial, uint32_t time, wl_surface *surface, uint32_t fingers) override 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 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: 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 ended(quint32 serial, quint32 time);
void cancelled(quint32 serial, quint32 time); void cancelled(quint32 serial, quint32 time);
}; };
@ -1126,7 +1126,6 @@ void TestWaylandSeat::testPointerHoldGesture()
PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer)); PointerHoldGesture gesture(gestures.get_hold_gesture(*pointer));
QVERIFY(gesture.isInitialized()); QVERIFY(gesture.isInitialized());
QSignalSpy startSpy(&gesture, &PointerHoldGesture::started); QSignalSpy startSpy(&gesture, &PointerHoldGesture::started);
QVERIFY(startSpy.isValid()); QVERIFY(startSpy.isValid());
QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended); QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended);
@ -1139,7 +1138,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QVERIFY(surfaceCreatedSpy.isValid()); QVERIFY(surfaceCreatedSpy.isValid());
QScopedPointer<Surface> surface(m_compositor->createSurface()); QScopedPointer<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait()); QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface*>(); auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface); QVERIFY(serverSurface);
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied); QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
@ -1162,7 +1161,7 @@ void TestWaylandSeat::testPointerHoldGesture()
QCOMPARE(startSpy.count(), 1); QCOMPARE(startSpy.count(), 1);
QCOMPARE(startSpy.first().at(0).value<quint32>(), m_display->serial()); QCOMPARE(startSpy.first().at(0).value<quint32>(), m_display->serial());
QCOMPARE(startSpy.first().at(1).value<quint32>(), 1u); QCOMPARE(startSpy.first().at(1).value<quint32>(), 1u);
QCOMPARE(startSpy.first().at(2).value<void*>(), *surface.get()); QCOMPARE(startSpy.first().at(2).value<void *>(), *surface.get());
QCOMPARE(startSpy.first().at(3).value<quint32>(), 3); QCOMPARE(startSpy.first().at(3).value<quint32>(), 3);
// another start should not be possible // another start should not be possible

View file

@ -107,10 +107,10 @@ void TestSlide::init()
void TestSlide::cleanup() void TestSlide::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)
CLEANUP(m_slideManager) CLEANUP(m_slideManager)

View file

@ -140,10 +140,10 @@ void TestForeign::init()
void TestForeign::cleanup() void TestForeign::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_compositor) CLEANUP(m_compositor)

View file

@ -75,14 +75,14 @@ private:
Seat *m_seat = nullptr; Seat *m_seat = nullptr;
}; };
#define SURFACE \ #define SURFACE \
QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \ QSignalSpy xdgSurfaceCreatedSpy(m_xdgShellInterface, &XdgShellInterface::toplevelCreated); \
QVERIFY(xdgSurfaceCreatedSpy.isValid()); \ QVERIFY(xdgSurfaceCreatedSpy.isValid()); \
QScopedPointer<Surface> surface(m_compositor->createSurface()); \ QScopedPointer<Surface> surface(m_compositor->createSurface()); \
QScopedPointer<XdgShellSurface> xdgSurface(m_xdgShell->createSurface(surface.data())); \ QScopedPointer<XdgShellSurface> xdgSurface(m_xdgShell->createSurface(surface.data())); \
QCOMPARE(xdgSurface->size(), QSize()); \ QCOMPARE(xdgSurface->size(), QSize()); \
QVERIFY(xdgSurfaceCreatedSpy.wait()); \ QVERIFY(xdgSurfaceCreatedSpy.wait()); \
auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value<XdgToplevelInterface *>(); \ auto serverXdgToplevel = xdgSurfaceCreatedSpy.first().first().value<XdgToplevelInterface *>(); \
QVERIFY(serverXdgToplevel); QVERIFY(serverXdgToplevel);
void XdgShellTest::init() void XdgShellTest::init()
@ -164,10 +164,10 @@ void XdgShellTest::init()
void XdgShellTest::cleanup() void XdgShellTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_xdgShell) CLEANUP(m_xdgShell)
CLEANUP(m_compositor) CLEANUP(m_compositor)

View file

@ -219,10 +219,10 @@ void DataControlInterfaceTest::init()
void DataControlInterfaceTest::cleanup() void DataControlInterfaceTest::cleanup()
{ {
#define CLEANUP(variable) \ #define CLEANUP(variable) \
if (variable) { \ if (variable) { \
delete variable; \ delete variable; \
variable = nullptr; \ variable = nullptr; \
} }
CLEANUP(m_dataControlDeviceManager) CLEANUP(m_dataControlDeviceManager)
CLEANUP(m_clientSeat) CLEANUP(m_clientSeat)

View file

@ -35,7 +35,8 @@ public:
QPointer<DataSourceInterface> selection; QPointer<DataSourceInterface> selection;
QPointer<SurfaceInterface> proxyRemoteSurface; QPointer<SurfaceInterface> proxyRemoteSurface;
struct Drag { struct Drag
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QMetaObject::Connection posConnection; QMetaObject::Connection posConnection;

View file

@ -157,7 +157,7 @@ QList<OutputInterface *> Display::outputs() const
return d->outputs; return d->outputs;
} }
QList< OutputDeviceV2Interface* > Display::outputDevices() const QList<OutputDeviceV2Interface *> Display::outputDevices() const
{ {
return d->outputdevicesV2; return d->outputdevicesV2;
} }
@ -233,7 +233,8 @@ void *Display::eglDisplay() const
return d->eglDisplay; return d->eglDisplay;
} }
struct ClientBufferDestroyListener : wl_listener { struct ClientBufferDestroyListener : wl_listener
{
ClientBufferDestroyListener(Display *display, ClientBuffer *buffer); ClientBufferDestroyListener(Display *display, ClientBuffer *buffer);
~ClientBufferDestroyListener(); ~ClientBufferDestroyListener();

View file

@ -111,7 +111,7 @@ public:
/** /**
* @returns All SeatInterface currently managed on the Display. * @returns All SeatInterface currently managed on the Display.
*/ */
QVector<SeatInterface*> seats() const; QVector<SeatInterface *> seats() const;
QList<OutputDeviceV2Interface *> outputDevices() const; QList<OutputDeviceV2Interface *> outputDevices() const;
QList<OutputInterface *> outputs() const; QList<OutputInterface *> outputs() const;
QVector<OutputInterface *> outputsIntersecting(const QRect &rect) const; QVector<OutputInterface *> outputsIntersecting(const QRect &rect) const;

View file

@ -5,8 +5,8 @@
*/ */
#include "drmleasedevice_v1_interface.h" #include "drmleasedevice_v1_interface.h"
#include "drmleasedevice_v1_interface_p.h"
#include "display.h" #include "display.h"
#include "drmleasedevice_v1_interface_p.h"
#include "logging.h" #include "logging.h"
#include "utils.h" #include "utils.h"
@ -60,7 +60,6 @@ void DrmLeaseDeviceV1Interface::setDrmMaster(bool hasDrmMaster)
d->hasDrmMaster = hasDrmMaster; d->hasDrmMaster = hasDrmMaster;
} }
DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function<int()> createNonMasterFd) DrmLeaseDeviceV1InterfacePrivate::DrmLeaseDeviceV1InterfacePrivate(Display *display, DrmLeaseDeviceV1Interface *device, std::function<int()> createNonMasterFd)
: QtWaylandServer::wp_drm_lease_device_v1(*display, s_version) : QtWaylandServer::wp_drm_lease_device_v1(*display, s_version)
, q(device) , q(device)
@ -165,7 +164,6 @@ void DrmLeaseDeviceV1InterfacePrivate::wp_drm_lease_device_v1_destroy_global()
delete this; delete this;
} }
DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice, DrmLeaseConnectorV1Interface::DrmLeaseConnectorV1Interface(DrmLeaseDeviceV1Interface *leaseDevice,
uint32_t id, uint32_t id,
const QString &name, const QString &name,
@ -186,7 +184,7 @@ DrmLeaseConnectorV1Interface::~DrmLeaseConnectorV1Interface()
DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource) DrmLeaseConnectorV1Interface *DrmLeaseConnectorV1Interface::get(wl_resource *resource)
{ {
if (auto connectorPrivate = resource_cast<DrmLeaseConnectorV1InterfacePrivate*>(resource)) { if (auto connectorPrivate = resource_cast<DrmLeaseConnectorV1InterfacePrivate *>(resource)) {
return connectorPrivate->q; return connectorPrivate->q;
} }
return nullptr; return nullptr;
@ -239,7 +237,6 @@ void DrmLeaseConnectorV1InterfacePrivate::wp_drm_lease_connector_v1_destroy(Reso
wl_resource_destroy(resource->handle); wl_resource_destroy(resource->handle);
} }
DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource) DrmLeaseRequestV1Interface::DrmLeaseRequestV1Interface(DrmLeaseDeviceV1InterfacePrivate *device, wl_resource *resource)
: wp_drm_lease_request_v1(resource) : wp_drm_lease_request_v1(resource)
, device(device) , device(device)
@ -363,7 +360,6 @@ QVector<DrmLeaseConnectorV1Interface *> DrmLeaseV1Interface::connectors() const
return d->connectors; return d->connectors;
} }
DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource) DrmLeaseV1InterfacePrivate::DrmLeaseV1InterfacePrivate(DrmLeaseDeviceV1InterfacePrivate *device, DrmLeaseV1Interface *q, wl_resource *resource)
: wp_drm_lease_v1(resource) : wp_drm_lease_v1(resource)
, device(device) , device(device)

View file

@ -40,6 +40,7 @@ public:
std::function<int()> createNonMasterFd; std::function<int()> createNonMasterFd;
bool hasDrmMaster = true; bool hasDrmMaster = true;
bool removed = false; bool removed = false;
protected: protected:
void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id) override; 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; void wp_drm_lease_device_v1_release(Resource *resource) override;
@ -66,6 +67,7 @@ public:
QString name; QString name;
QString description; QString description;
bool withdrawn = false; bool withdrawn = false;
protected: protected:
void wp_drm_lease_connector_v1_destroy(Resource *resource) override; void wp_drm_lease_connector_v1_destroy(Resource *resource) override;
}; };
@ -79,6 +81,7 @@ public:
DrmLeaseDeviceV1InterfacePrivate *device; DrmLeaseDeviceV1InterfacePrivate *device;
QVector<DrmLeaseConnectorV1Interface *> connectors; QVector<DrmLeaseConnectorV1Interface *> connectors;
bool invalid = false; bool invalid = false;
protected: protected:
void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector) override; 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; void wp_drm_lease_request_v1_submit(Resource *resource, uint32_t id) override;
@ -95,10 +98,10 @@ public:
QVector<DrmLeaseConnectorV1Interface *> connectors; QVector<DrmLeaseConnectorV1Interface *> connectors;
uint32_t lesseeId = 0; uint32_t lesseeId = 0;
bool finished = false; bool finished = false;
protected: protected:
void wp_drm_lease_v1_destroy(Resource *resource) override; void wp_drm_lease_v1_destroy(Resource *resource) override;
void wp_drm_lease_v1_destroy_resource(Resource *resource) override; void wp_drm_lease_v1_destroy_resource(Resource *resource) override;
}; };
} }

View file

@ -201,10 +201,10 @@ void KeyboardInterface::sendKey(quint32 key, KeyboardKeyState state)
void KeyboardInterface::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group) void KeyboardInterface::sendModifiers(quint32 depressed, quint32 latched, quint32 locked, quint32 group)
{ {
bool changed = false; bool changed = false;
#define UPDATE(value) \ #define UPDATE(value) \
if (d->modifiers.value != value) { \ if (d->modifiers.value != value) { \
d->modifiers.value = value; \ d->modifiers.value = value; \
changed = true; \ changed = true; \
} }
UPDATE(depressed) UPDATE(depressed)
UPDATE(latched) UPDATE(latched)

View file

@ -39,12 +39,14 @@ public:
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QByteArray keymap; QByteArray keymap;
struct { struct
{
qint32 charactersPerSecond = 0; qint32 charactersPerSecond = 0;
qint32 delay = 0; qint32 delay = 0;
} keyRepeat; } keyRepeat;
struct Modifiers { struct Modifiers
{
quint32 depressed = 0; quint32 depressed = 0;
quint32 latched = 0; quint32 latched = 0;
quint32 locked = 0; quint32 locked = 0;

View file

@ -59,7 +59,12 @@ class KWAYLANDSERVER_EXPORT LayerSurfaceV1Interface : public QObject
Q_OBJECT Q_OBJECT
public: public:
enum Layer { BackgroundLayer, BottomLayer, TopLayer, OverlayLayer }; enum Layer {
BackgroundLayer,
BottomLayer,
TopLayer,
OverlayLayer,
};
LayerSurfaceV1Interface(LayerShellV1Interface *shell, LayerSurfaceV1Interface(LayerShellV1Interface *shell,
SurfaceInterface *surface, SurfaceInterface *surface,

View file

@ -16,8 +16,8 @@
#include "surface_interface_p.h" #include "surface_interface_p.h"
#include <QTemporaryFile> #include <QTemporaryFile>
#include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <unistd.h> #include <unistd.h>
namespace KWaylandServer namespace KWaylandServer
@ -508,7 +508,8 @@ void LinuxDmaBufV1FeedbackPrivate::zwp_linux_dmabuf_feedback_v1_destroy(Resource
wl_resource_destroy(resource->handle); wl_resource_destroy(resource->handle);
} }
struct linux_dmabuf_feedback_v1_table_entry { struct linux_dmabuf_feedback_v1_table_entry
{
uint32_t format; uint32_t format;
uint32_t pad; // unused uint32_t pad; // unused
uint64_t modifier; uint64_t modifier;

View file

@ -24,7 +24,8 @@ class LinuxDmaBufV1FeedbackPrivate;
/** /**
* The LinuxDmaBufV1Plane type represents a plane in a client buffer. * The LinuxDmaBufV1Plane type represents a plane in a client buffer.
*/ */
struct LinuxDmaBufV1Plane { struct LinuxDmaBufV1Plane
{
int fd = -1; ///< The dmabuf file descriptor int fd = -1; ///< The dmabuf file descriptor
quint32 offset = 0; ///< The offset from the start of buffer 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 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) Q_DECLARE_FLAGS(TrancheFlags, TrancheFlag)
struct Tranche { struct Tranche
{
dev_t device; dev_t device;
TrancheFlags flags; TrancheFlags flags;
QHash<uint32_t, QVector<uint64_t>> formatTable; QHash<uint32_t, QVector<uint64_t>> formatTable;

View file

@ -40,7 +40,8 @@ public:
OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown; OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown;
OutputInterface::Transform transform = OutputInterface::Transform::Normal; OutputInterface::Transform transform = OutputInterface::Transform::Normal;
OutputInterface::Mode mode; OutputInterface::Mode mode;
struct { struct
{
OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off; OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off;
bool supported = false; bool supported = false;
} dpms; } dpms;

View file

@ -54,7 +54,8 @@ public:
Flipped180, Flipped180,
Flipped270, Flipped270,
}; };
struct Mode { struct Mode
{
QSize size = QSize(); QSize size = QSize();
int refreshRate = 60000; int refreshRate = 60000;
}; };

View file

@ -40,7 +40,7 @@ public:
* @returns @c true if the enabled property of the outputdevice has changed. * @returns @c true if the enabled property of the outputdevice has changed.
* bool modeChanged() const; * bool modeChanged() const;
*/ */
/** Whether the transform() property of the outputdevice changed. */ /** Whether the transform() property of the outputdevice changed. */
bool transformChanged() const; bool transformChanged() const;
/** Whether the size property of the outputdevice changed. /** Whether the size property of the outputdevice changed.

View file

@ -5,14 +5,14 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 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 "outputconfiguration_v2_interface.h"
#include "outputdevice_v2_interface.h" #include "display.h"
#include "logging.h" #include "logging.h"
#include "outputchangeset_v2_p.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-device-v2.h"
#include "qwayland-server-kde-output-management-v2.h"
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>
@ -56,7 +56,7 @@ protected:
void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable)
{ {
Q_UNUSED(resource) Q_UNUSED(resource)
OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice);
pendingChanges(output)->d->enabled = enable == 1; pendingChanges(output)->d->enabled = enable == 1;
} }
@ -76,23 +76,23 @@ void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_transfor
Q_UNUSED(resource) Q_UNUSED(resource)
auto toTransform = [transform]() { auto toTransform = [transform]() {
switch (transform) { switch (transform) {
case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_90:
return OutputDeviceV2Interface::Transform::Rotated90; return OutputDeviceV2Interface::Transform::Rotated90;
case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_180:
return OutputDeviceV2Interface::Transform::Rotated180; return OutputDeviceV2Interface::Transform::Rotated180;
case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_270:
return OutputDeviceV2Interface::Transform::Rotated270; return OutputDeviceV2Interface::Transform::Rotated270;
case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED:
return OutputDeviceV2Interface::Transform::Flipped; return OutputDeviceV2Interface::Transform::Flipped;
case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_90:
return OutputDeviceV2Interface::Transform::Flipped90; return OutputDeviceV2Interface::Transform::Flipped90;
case WL_OUTPUT_TRANSFORM_FLIPPED_180: case WL_OUTPUT_TRANSFORM_FLIPPED_180:
return OutputDeviceV2Interface::Transform::Flipped180; return OutputDeviceV2Interface::Transform::Flipped180;
case WL_OUTPUT_TRANSFORM_FLIPPED_270: case WL_OUTPUT_TRANSFORM_FLIPPED_270:
return OutputDeviceV2Interface::Transform::Flipped270; return OutputDeviceV2Interface::Transform::Flipped270;
case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_NORMAL:
default: default:
return OutputDeviceV2Interface::Transform::Normal; return OutputDeviceV2Interface::Transform::Normal;
} }
}; };
auto _transform = toTransform(); auto _transform = toTransform();
@ -118,7 +118,7 @@ void OutputConfigurationV2InterfacePrivate::kde_output_configuration_v2_scale(Re
return; return;
} }
OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice);
pendingChanges(output)->d->scale = doubleScale; pendingChanges(output)->d->scale = doubleScale;
} }
@ -190,7 +190,7 @@ OutputConfigurationV2InterfacePrivate::OutputConfigurationV2InterfacePrivate(Out
{ {
} }
QHash<OutputDeviceV2Interface*, OutputChangeSetV2*> OutputConfigurationV2Interface::changes() const QHash<OutputDeviceV2Interface *, OutputChangeSetV2 *> OutputConfigurationV2Interface::changes() const
{ {
return d->changes; return d->changes;
} }
@ -244,12 +244,7 @@ bool OutputConfigurationV2InterfacePrivate::hasPendingChanges(OutputDeviceV2Inte
return false; return false;
} }
auto c = *it; auto c = *it;
return c->enabledChanged() || return c->enabledChanged() || c->sizeChanged() || c->refreshRateChanged() || c->transformChanged() || c->positionChanged() || c->scaleChanged();
c->sizeChanged() ||
c->refreshRateChanged() ||
c->transformChanged() ||
c->positionChanged() ||
c->scaleChanged();
} }
void OutputConfigurationV2InterfacePrivate::clearPendingChanges() void OutputConfigurationV2InterfacePrivate::clearPendingChanges()

View file

@ -6,9 +6,9 @@
*/ */
#pragma once #pragma once
#include "outputmanagement_v2_interface.h"
#include "outputdevice_v2_interface.h"
#include "outputchangeset_v2.h" #include "outputchangeset_v2.h"
#include "outputdevice_v2_interface.h"
#include "outputmanagement_v2_interface.h"
#include <KWaylandServer/kwaylandserver_export.h> #include <KWaylandServer/kwaylandserver_export.h>
@ -88,7 +88,6 @@ private:
QScopedPointer<OutputConfigurationV2InterfacePrivate> d; QScopedPointer<OutputConfigurationV2InterfacePrivate> d;
}; };
} }
Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface*) Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface *)

View file

@ -6,14 +6,14 @@
*/ */
#include "outputdevice_v2_interface.h" #include "outputdevice_v2_interface.h"
#include "display_p.h"
#include "display.h" #include "display.h"
#include "display_p.h"
#include "logging.h" #include "logging.h"
#include "utils.h" #include "utils.h"
#include <QDebug> #include <QDebug>
#include <QString>
#include <QPointer> #include <QPointer>
#include <QString>
#include <wayland-client-protocol.h> #include <wayland-client-protocol.h>
@ -84,7 +84,8 @@ protected:
class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2 class OutputDeviceModeV2InterfacePrivate : public QtWaylandServer::kde_output_device_mode_v2
{ {
public: public:
struct ModeResource : Resource { struct ModeResource : Resource
{
OutputDeviceV2InterfacePrivate::Resource *output; OutputDeviceV2InterfacePrivate::Resource *output;
}; };
@ -96,7 +97,10 @@ public:
void bindResource(wl_resource *resource); 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; OutputDeviceModeV2Interface *q;
@ -174,7 +178,7 @@ void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode)
} }
if (d->currentMode) { if (d->currentMode) {
// another mode has the current flag - remove // 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); mode->setFlags(mode->flags() | OutputDeviceModeV2Interface::ModeFlag::Current);
@ -191,11 +195,9 @@ void OutputDeviceV2Interface::setCurrentMode(OutputDeviceModeV2Interface *mode)
bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate) bool OutputDeviceV2Interface::setCurrentMode(const QSize &size, int refreshRate)
{ {
auto mode = std::find_if(d->modes.begin(), d->modes.end(), auto mode = std::find_if(d->modes.begin(), d->modes.end(), [size, refreshRate](OutputDeviceModeV2Interface *mode) {
[size, refreshRate](OutputDeviceModeV2Interface *mode) { return mode->size() == size && mode->refreshRate() == refreshRate;
return mode->size() == size && mode->refreshRate() == refreshRate; });
}
);
if (mode == d->modes.end()) { if (mode == d->modes.end()) {
return false; return false;
} }
@ -296,14 +298,14 @@ void OutputDeviceV2InterfacePrivate::sendCurrentMode(Resource *outputResource)
void OutputDeviceV2InterfacePrivate::sendGeometry(Resource *resource) void OutputDeviceV2InterfacePrivate::sendGeometry(Resource *resource)
{ {
send_geometry(resource->handle, send_geometry(resource->handle,
globalPosition.x(), globalPosition.x(),
globalPosition.y(), globalPosition.y(),
physicalSize.width(), physicalSize.width(),
physicalSize.height(), physicalSize.height(),
toSubPixel(), toSubPixel(),
manufacturer, manufacturer,
model, model,
toTransform()); toTransform());
} }
void OutputDeviceV2InterfacePrivate::sendScale(Resource *resource) void OutputDeviceV2InterfacePrivate::sendScale(Resource *resource)
@ -692,12 +694,14 @@ OutputDeviceModeV2InterfacePrivate::OutputDeviceModeV2InterfacePrivate(OutputDev
, m_size(size) , m_size(size)
, m_refreshRate(refreshRate) , m_refreshRate(refreshRate)
, m_flags(flags) , m_flags(flags)
{} {
}
OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent) OutputDeviceModeV2Interface::OutputDeviceModeV2Interface(const QSize &size, int refreshRate, ModeFlags flags, QObject *parent)
: QObject(parent) : QObject(parent)
, d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags)) , d(new OutputDeviceModeV2InterfacePrivate(this, size, refreshRate, flags))
{} {
}
OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default; OutputDeviceModeV2Interface::~OutputDeviceModeV2Interface() = default;

View file

@ -24,7 +24,6 @@ class OutputDeviceV2InterfacePrivate;
class OutputDeviceModeV2Interface; class OutputDeviceModeV2Interface;
class OutputDeviceModeV2InterfacePrivate; class OutputDeviceModeV2InterfacePrivate;
/** @class OutputDeviceV2Interface /** @class OutputDeviceV2Interface
* *
* Represents an output device, the difference to Output is that this output can be disabled, * 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. * Represents an output device mode.
* *
* @see OutputDeviceV2Interface * @see OutputDeviceV2Interface
*/ */
class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject class KWAYLANDSERVER_EXPORT OutputDeviceModeV2Interface : public QObject
{ {

View file

@ -4,12 +4,12 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 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 "outputmanagement_v2_interface.h"
#include "display.h"
#include "outputconfiguration_v2_interface.h" #include "outputconfiguration_v2_interface.h"
#include <wayland-server.h>
#include "qwayland-server-kde-output-management-v2.h" #include "qwayland-server-kde-output-management-v2.h"
#include <wayland-server.h>
#include <QHash> #include <QHash>

View file

@ -538,7 +538,6 @@ public:
*/ */
void startPointerHoldGesture(quint32 fingerCount); void startPointerHoldGesture(quint32 fingerCount);
/** /**
* The multi-finger hold gesture ended. This may happen when one or more fingers are lifted. * The multi-finger hold gesture ended. This may happen when one or more fingers are lifted.
* @see startPointerHoldGesture * @see startPointerHoldGesture

View file

@ -69,7 +69,8 @@ public:
AbstractDataSource *currentPrimarySelection = nullptr; AbstractDataSource *currentPrimarySelection = nullptr;
// Pointer related members // Pointer related members
struct Pointer { struct Pointer
{
enum class State { enum class State {
Released, Released,
Pressed, Pressed,
@ -77,7 +78,8 @@ public:
QHash<quint32, quint32> buttonSerials; QHash<quint32, quint32> buttonSerials;
QHash<quint32, State> buttonStates; QHash<quint32, State> buttonStates;
QPointF pos; QPointF pos;
struct Focus { struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QPointF offset = QPointF(); QPointF offset = QPointF();
@ -91,8 +93,10 @@ public:
void updatePointerButtonState(quint32 button, Pointer::State state); void updatePointerButtonState(quint32 button, Pointer::State state);
// Keyboard related members // Keyboard related members
struct Keyboard { struct Keyboard
struct Focus { {
struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
quint32 serial = 0; quint32 serial = 0;
@ -104,8 +108,10 @@ public:
Keyboard globalKeyboard; Keyboard globalKeyboard;
// Touch related members // Touch related members
struct Touch { struct Touch
struct Focus { {
struct Focus
{
SurfaceInterface *surface = nullptr; SurfaceInterface *surface = nullptr;
QMetaObject::Connection destroyConnection; QMetaObject::Connection destroyConnection;
QPointF offset = QPointF(); QPointF offset = QPointF();
@ -117,7 +123,8 @@ public:
}; };
Touch globalTouch; Touch globalTouch;
struct Drag { struct Drag
{
enum class Mode { enum class Mode {
None, None,
Pointer, Pointer,

View file

@ -91,7 +91,8 @@ public:
ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource); ShadowInterfacePrivate(ShadowInterface *_q, wl_resource *resource);
~ShadowInterfacePrivate(); ~ShadowInterfacePrivate();
struct State { struct State
{
enum Flags { enum Flags {
None = 0, None = 0,
LeftBuffer = 1 << 0, LeftBuffer = 1 << 0,
@ -145,15 +146,15 @@ protected:
void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource) void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource)
{ {
Q_UNUSED(resource) Q_UNUSED(resource)
#define BUFFER(__FLAG__, __PART__) \ #define BUFFER(__FLAG__, __PART__) \
if (pending.flags & State::Flags::__FLAG__##Buffer) { \ if (pending.flags & State::Flags::__FLAG__##Buffer) { \
if (current.__PART__) { \ if (current.__PART__) { \
current.__PART__->unref(); \ current.__PART__->unref(); \
} \ } \
if (pending.__PART__) { \ if (pending.__PART__) { \
pending.__PART__->ref(); \ pending.__PART__->ref(); \
} \ } \
current.__PART__ = pending.__PART__; \ current.__PART__ = pending.__PART__; \
} }
BUFFER(Left, left) BUFFER(Left, left)
BUFFER(TopLeft, topLeft) BUFFER(TopLeft, topLeft)
@ -301,9 +302,9 @@ ShadowInterfacePrivate::ShadowInterfacePrivate(ShadowInterface *_q, wl_resource
ShadowInterfacePrivate::~ShadowInterfacePrivate() ShadowInterfacePrivate::~ShadowInterfacePrivate()
{ {
#define CURRENT(__PART__) \ #define CURRENT(__PART__) \
if (current.__PART__) { \ if (current.__PART__) { \
current.__PART__->unref(); \ current.__PART__->unref(); \
} }
CURRENT(left) CURRENT(left)
CURRENT(topLeft) CURRENT(topLeft)
@ -330,10 +331,10 @@ QMarginsF ShadowInterface::offset() const
return d->current.offset; return d->current.offset;
} }
#define BUFFER(__PART__) \ #define BUFFER(__PART__) \
ClientBuffer *ShadowInterface::__PART__() const \ ClientBuffer *ShadowInterface::__PART__() const \
{ \ { \
return d->current.__PART__; \ return d->current.__PART__; \
} }
BUFFER(left) BUFFER(left)

View file

@ -30,7 +30,8 @@ public:
bool hasAlphaChannel = false; bool hasAlphaChannel = false;
QImage savedData; QImage savedData;
struct DestroyListener { struct DestroyListener
{
wl_listener listener; wl_listener listener;
ShmClientBufferPrivate *receiver; ShmClientBufferPrivate *receiver;
}; };

View file

@ -38,16 +38,13 @@ SurfaceInterfacePrivate::~SurfaceInterfacePrivate()
wl_resource *resource; wl_resource *resource;
wl_resource *tmp; wl_resource *tmp;
wl_resource_for_each_safe(resource, tmp, &current.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &current.frameCallbacks) {
{
wl_resource_destroy(resource); 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_destroy(resource);
} }
wl_resource_for_each_safe(resource, tmp, &cached.frameCallbacks) wl_resource_for_each_safe (resource, tmp, &cached.frameCallbacks) {
{
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }
@ -368,8 +365,7 @@ void SurfaceInterface::frameRendered(quint32 msec)
wl_resource *resource; wl_resource *resource;
wl_resource *tmp; 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_callback_send_done(resource, msec);
wl_resource_destroy(resource); wl_resource_destroy(resource);
} }

View file

@ -20,7 +20,8 @@ class IdleInhibitorV1Interface;
class SurfaceRole; class SurfaceRole;
class ViewportInterface; class ViewportInterface;
struct SurfaceState { struct SurfaceState
{
void mergeInto(SurfaceState *target); void mergeInto(SurfaceState *target);
QRegion damage = QRegion(); QRegion damage = QRegion();
@ -53,7 +54,8 @@ struct SurfaceState {
QList<SubSurfaceInterface *> below; QList<SubSurfaceInterface *> below;
QList<SubSurfaceInterface *> above; QList<SubSurfaceInterface *> above;
struct { struct
{
QRectF sourceGeometry = QRectF(); QRectF sourceGeometry = QRectF();
QSize destinationSize = QSize(); QSize destinationSize = QSize();
bool sourceGeometryIsSet = false; bool sourceGeometryIsSet = false;

View file

@ -59,7 +59,8 @@ private:
PlasmaShell *m_plasmaShell = nullptr; PlasmaShell *m_plasmaShell = nullptr;
PlasmaShellSurface *m_plasmaShellSurface = nullptr; PlasmaShellSurface *m_plasmaShellSurface = nullptr;
PlasmaWindowManagement *m_windowManagement = nullptr; PlasmaWindowManagement *m_windowManagement = nullptr;
struct { struct
{
Surface *surface = nullptr; Surface *surface = nullptr;
ShellSurface *shellSurface = nullptr; ShellSurface *shellSurface = nullptr;
PlasmaShellSurface *plasmaSurface = nullptr; PlasmaShellSurface *plasmaSurface = nullptr;

View file

@ -63,7 +63,8 @@ public:
qint32 surroundingTextSelectionAnchor = 0; qint32 surroundingTextSelectionAnchor = 0;
TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod;
struct { struct
{
QRect cursorRectangle; QRect cursorRectangle;
TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod; TextInputChangeCause surroundingTextChangeCause = TextInputChangeCause::InputMethod;
TextInputContentHints contentHints = TextInputContentHint::None; TextInputContentHints contentHints = TextInputContentHint::None;

View file

@ -18,7 +18,8 @@ struct wl_resource;
namespace KWaylandServer namespace KWaylandServer
{ {
template<typename T> template<typename T>
struct SafeGlobalDeleter { struct SafeGlobalDeleter
{
static inline void cleanup(T *global) static inline void cleanup(T *global)
{ {
if (global) { if (global) {

View file

@ -61,7 +61,12 @@ class KWAYLANDSERVER_EXPORT XdgToplevelDecorationV1Interface : public QObject
Q_OBJECT Q_OBJECT
public: public:
enum class Mode { Undefined, None, Client, Server }; enum class Mode {
Undefined,
None,
Client,
Server,
};
Q_ENUM(Mode) Q_ENUM(Mode)
/** /**

View file

@ -83,7 +83,8 @@ protected:
void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override; void xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) override;
}; };
struct XdgSurfaceState { struct XdgSurfaceState
{
QRect windowGeometry; QRect windowGeometry;
quint32 acknowledgedConfigure; quint32 acknowledgedConfigure;
bool acknowledgedConfigureIsSet = false; bool acknowledgedConfigureIsSet = false;
@ -139,7 +140,8 @@ public:
QString windowTitle; QString windowTitle;
QString windowClass; QString windowClass;
struct State { struct State
{
QSize minimumSize; QSize minimumSize;
QSize maximumSize; QSize maximumSize;
}; };