kwin/src/xwl/drag.cpp
Vlad Zahorodnii 7096e3ead8 Run clang-format
The .clang-format file is based on the one in ECM except the following
style options:

 - AlwaysBreakBeforeMultilineStrings
 - BinPackArguments
 - BinPackParameters
 - ColumnLimit
 - BreakBeforeBraces
 - KeepEmptyLinesAtTheStartOfBlocks
2022-03-25 13:25:15 +02:00

50 lines
1.1 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
SPDX-FileCopyrightText: 2021 David Redondo <kde@david-redondo.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "drag.h"
#include "atoms.h"
namespace KWin
{
namespace Xwl
{
Drag::Drag(QObject *parent)
: QObject(parent)
{
}
Drag::~Drag()
{
}
void Drag::sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data)
{
xcb_client_message_event_t event{
XCB_CLIENT_MESSAGE, // response_type
32, // format
0, // sequence
target, // window
type, // type
*data, // data
};
static_assert(sizeof(event) == 32, "Would leak stack data otherwise");
xcb_connection_t *xcbConn = kwinApp()->x11Connection();
xcb_send_event(xcbConn,
0,
target,
XCB_EVENT_MASK_NO_EVENT,
reinterpret_cast<const char *>(&event));
xcb_flush(xcbConn);
}
} // namespace Xwl
} // namespace KWin