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>
|
2018-08-22 12:56:48 +00:00
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
xcb_client_message_event_t event {
|
|
|
|
XCB_CLIENT_MESSAGE, // response_type
|
|
|
|
32, // format
|
|
|
|
0, // sequence
|
|
|
|
target, // window
|
|
|
|
type, // type
|
|
|
|
*data, // data
|
|
|
|
};
|
|
|
|
|
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
|