KWin
Loading...
Searching...
No Matches
drag.cpp
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
6 SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
7 SPDX-FileCopyrightText: 2021 David Redondo <kde@david-redondo.de>
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10#include "drag.h"
11
12#include "atoms.h"
13
14namespace KWin
15{
16namespace Xwl
17{
18
19Drag::Drag(QObject *parent)
20 : QObject(parent)
21{
22}
23
25{
26}
27
28void Drag::sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data)
29{
30 xcb_client_message_event_t event{
31 XCB_CLIENT_MESSAGE, // response_type
32 32, // format
33 0, // sequence
34 target, // window
35 type, // type
36 *data, // data
37 };
38 static_assert(sizeof(event) == 32, "Would leak stack data otherwise");
39
40 xcb_connection_t *xcbConn = kwinApp()->x11Connection();
41 xcb_send_event(xcbConn,
42 0,
43 target,
44 XCB_EVENT_MASK_NO_EVENT,
45 reinterpret_cast<const char *>(&event));
46 xcb_flush(xcbConn);
47}
48
49} // namespace Xwl
50} // namespace KWin
51
52#include "moc_drag.cpp"
Drag(QObject *parent=nullptr)
Definition drag.cpp:19
static void sendClientMessage(xcb_window_t target, xcb_atom_t type, xcb_client_message_data_t *data)
Definition drag.cpp:28
~Drag() override
Definition drag.cpp:24
Session::Type type
Definition session.cpp:17