KWin
Loading...
Searching...
No Matches
xwayland.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: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10#pragma once
11
12#include <memory>
13
14#include "xwayland_interface.h"
15
16#include <memory>
17
18class KSelectionOwner;
19class QSocketNotifier;
20
21namespace KWin
22{
23class Output;
24class Application;
25
26namespace Xwl
27{
28class XrandrEventFilter;
29class XwaylandInputSpy;
30class XwaylandLauncher;
31class DataBridge;
32
33class KWIN_EXPORT Xwayland : public QObject, public XwaylandInterface
34{
35 Q_OBJECT
36
37public:
39 ~Xwayland() override;
40
41 void init();
42
43 XwaylandLauncher *xwaylandLauncher() const;
44
45Q_SIGNALS:
50 void started();
51
56
57private Q_SLOTS:
58 void handleXwaylandFinished();
59 void handleXwaylandReady();
60
61 void handleSelectionLostOwnership();
62 void handleSelectionFailedToClaimOwnership();
63 void handleSelectionClaimedOwnership();
64
65private:
66 friend class XrandrEventFilter;
67
68 enum class DispatchEventsMode {
69 Poll,
70 EventQueue
71 };
72 void dispatchEvents(DispatchEventsMode mode);
73
74 void installSocketNotifier();
75 void uninstallSocketNotifier();
76 void updatePrimary();
77 void refreshEavesdropping();
78
79 bool createX11Connection();
80 void destroyX11Connection();
81
82 DragEventReply dragMoveFilter(Window *target) override;
83 AbstractDropHandler *xwlDropHandler() override;
84 QSocketNotifier *m_socketNotifier = nullptr;
85
86 Application *m_app;
87 std::unique_ptr<KSelectionOwner> m_windowManagerSelectionOwner;
88 std::unique_ptr<KSelectionOwner> m_compositingManagerSelectionOwner;
89 std::unique_ptr<DataBridge> m_dataBridge;
90
91 XrandrEventFilter *m_xrandrEventsFilter = nullptr;
92 XwaylandLauncher *m_launcher;
93 std::unique_ptr<XwaylandInputSpy> m_inputSpy;
94
95 Q_DISABLE_COPY(Xwayland)
96};
97
98} // namespace Xwl
99} // namespace KWin