KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
primary.h
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 Redondo <kde@david-redondo.de>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10#pragma once
11
12#include "selection.h"
13
14#include <memory>
15
16namespace KWin
17{
18class AbstractDataSource;
19
20namespace Xwl
21{
22class XwlDataSource;
23
28class Primary : public Selection
29{
30 Q_OBJECT
31
32public:
33 Primary(xcb_atom_t atom, QObject *parent);
34 ~Primary() override;
35
36private:
37 void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override;
38 void x11OfferLost() override;
39 void x11OffersChanged(const QStringList &added, const QStringList &removed) override;
43 void wlPrimarySelectionChanged(AbstractDataSource *dsi);
48 void checkWlSource();
49
53 bool ownsSelection(AbstractDataSource *dsi) const;
54
55 QMetaObject::Connection m_checkConnection;
56
57 Q_DISABLE_COPY(Primary)
58 bool m_waitingForTargets = false;
59 std::unique_ptr<XwlDataSource> m_primarySelectionSource;
60};
61
62} // namespace Xwl
63} // namespace KWin
The AbstractDataSource class abstracts the data that can be transferred to another client.
~Primary() override
xcb_atom_t atom() const
Definition selection.h:59