2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2018-08-22 12:56:48 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
|
2021-09-03 11:47:57 +00:00
|
|
|
SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2021 David Redondo <kde@david-redondo.de>
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2018-08-22 12:56:48 +00:00
|
|
|
#include "drag.h"
|
|
|
|
|
|
|
|
#include "atoms.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
namespace Xwl
|
|
|
|
{
|
|
|
|
|
2019-07-02 19:56:03 +00:00
|
|
|
Drag::Drag(QObject *parent)
|
|
|
|
: QObject(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Drag::~Drag()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-08-22 12:56:48 +00:00
|
|
|
void Drag::sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data)
|
|
|
|
{
|
2022-03-23 10:13:38 +00:00
|
|
|
xcb_client_message_event_t event{
|
2018-08-22 12:56:48 +00:00
|
|
|
XCB_CLIENT_MESSAGE, // response_type
|
2022-03-23 10:13:38 +00:00
|
|
|
32, // format
|
|
|
|
0, // sequence
|
|
|
|
target, // window
|
|
|
|
type, // type
|
|
|
|
*data, // data
|
2018-08-22 12:56:48 +00:00
|
|
|
};
|
2021-09-09 15:10:48 +00:00
|
|
|
static_assert(sizeof(event) == 32, "Would leak stack data otherwise");
|
2018-08-22 12:56:48 +00:00
|
|
|
|
2019-07-02 19:56:03 +00:00
|
|
|
xcb_connection_t *xcbConn = kwinApp()->x11Connection();
|
2018-08-22 12:56:48 +00:00
|
|
|
xcb_send_event(xcbConn,
|
|
|
|
0,
|
|
|
|
target,
|
|
|
|
XCB_EVENT_MASK_NO_EVENT,
|
|
|
|
reinterpret_cast<const char *>(&event));
|
|
|
|
xcb_flush(xcbConn);
|
|
|
|
}
|
|
|
|
|
2019-07-02 19:56:03 +00:00
|
|
|
} // namespace Xwl
|
|
|
|
} // namespace KWin
|