Changeset View
Changeset View
Standalone View
Standalone View
xwl/xwayland.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 82 | Xwayland::Xwayland(ApplicationWaylandAbstract *app, QObject *parent) | |||
---|---|---|---|---|---|
83 | : XwaylandInterface(parent) | 83 | : XwaylandInterface(parent) | ||
84 | , m_app(app) | 84 | , m_app(app) | ||
85 | { | 85 | { | ||
86 | s_self = this; | 86 | s_self = this; | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | Xwayland::~Xwayland() | 89 | Xwayland::~Xwayland() | ||
90 | { | 90 | { | ||
91 | delete m_dataBridge; | ||||
92 | m_dataBridge = nullptr; | ||||
93 | | ||||
91 | disconnect(m_xwaylandFailConnection); | 94 | disconnect(m_xwaylandFailConnection); | ||
92 | if (m_app->x11Connection()) { | 95 | if (m_app->x11Connection()) { | ||
93 | Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT); | 96 | Xcb::setInputFocus(XCB_INPUT_FOCUS_POINTER_ROOT); | ||
94 | m_app->destroyAtoms(); | 97 | m_app->destroyAtoms(); | ||
95 | Q_EMIT m_app->x11ConnectionAboutToBeDestroyed(); | 98 | Q_EMIT m_app->x11ConnectionAboutToBeDestroyed(); | ||
96 | xcb_disconnect(m_app->x11Connection()); | 99 | xcb_disconnect(m_app->x11Connection()); | ||
97 | m_app->setX11Connection(nullptr); | 100 | m_app->setX11Connection(nullptr); | ||
98 | } | 101 | } | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 173 | [this, xDisplayPipe] { | |||
173 | QObject::connect(watcher, &QFutureWatcher<void>::finished, watcher, &QFutureWatcher<void>::deleteLater, Qt::QueuedConnection); | 176 | QObject::connect(watcher, &QFutureWatcher<void>::finished, watcher, &QFutureWatcher<void>::deleteLater, Qt::QueuedConnection); | ||
174 | watcher->setFuture(QtConcurrent::run(readDisplay, xDisplayPipe)); | 177 | watcher->setFuture(QtConcurrent::run(readDisplay, xDisplayPipe)); | ||
175 | } | 178 | } | ||
176 | ); | 179 | ); | ||
177 | m_xwaylandProcess->start(); | 180 | m_xwaylandProcess->start(); | ||
178 | close(pipeFds[1]); | 181 | close(pipeFds[1]); | ||
179 | } | 182 | } | ||
180 | 183 | | |||
181 | void Xwayland::prepareDestroy() | | |||
182 | { | | |||
183 | delete m_dataBridge; | | |||
184 | m_dataBridge = nullptr; | | |||
185 | } | | |||
186 | | ||||
187 | void Xwayland::createX11Connection() | 184 | void Xwayland::createX11Connection() | ||
188 | { | 185 | { | ||
189 | int screenNumber = 0; | 186 | int screenNumber = 0; | ||
190 | xcb_connection_t *c = nullptr; | 187 | xcb_connection_t *c = nullptr; | ||
191 | if (m_xcbConnectionFd == -1) { | 188 | if (m_xcbConnectionFd == -1) { | ||
192 | c = xcb_connect(nullptr, &screenNumber); | 189 | c = xcb_connect(nullptr, &screenNumber); | ||
193 | } else { | 190 | } else { | ||
194 | c = xcb_connect_to_fd(m_xcbConnectionFd, nullptr); | 191 | c = xcb_connect_to_fd(m_xcbConnectionFd, nullptr); | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |