Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 129 | { | |||
---|---|---|---|---|---|
153 | } else { | 153 | } else { | ||
154 | m_clients << client; | 154 | m_clients << client; | ||
155 | } | 155 | } | ||
156 | if (client->readyForPainting()) { | 156 | if (client->readyForPainting()) { | ||
157 | emit shellClientAdded(client); | 157 | emit shellClientAdded(client); | ||
158 | } else { | 158 | } else { | ||
159 | connect(client, &ShellClient::windowShown, this, &WaylandServer::shellClientShown); | 159 | connect(client, &ShellClient::windowShown, this, &WaylandServer::shellClientShown); | ||
160 | } | 160 | } | ||
161 | client->installXdgForeignUnstableInterface(m_XdgForeign); | ||||
161 | } | 162 | } | ||
graesslin: Why is the xdgForeign passed to the client? | |||||
162 | 163 | | |||
163 | bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags) | 164 | bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags) | ||
164 | { | 165 | { | ||
165 | m_initFlags = flags; | 166 | m_initFlags = flags; | ||
166 | m_display = new KWayland::Server::Display(this); | 167 | m_display = new KWayland::Server::Display(this); | ||
167 | if (!socketName.isNull() && !socketName.isEmpty()) { | 168 | if (!socketName.isNull() && !socketName.isEmpty()) { | ||
168 | m_display->setSocketName(QString::fromUtf8(socketName)); | 169 | m_display->setSocketName(QString::fromUtf8(socketName)); | ||
169 | } | 170 | } | ||
170 | m_display->start(); | 171 | m_display->start(); | ||
171 | if (!m_display->isRunning()) { | 172 | if (!m_display->isRunning()) { | ||
graesslin: why the setModal? Why should a foreign transient be modal? | |||||
172 | return false; | 173 | return false; | ||
as an alternative feel free to make ShellClient::setTransient public (it's only private because nothing used it so far) and do: if (childClient && childClient->surface() == child) { childClient->setTransient(); } graesslin: as an alternative feel free to make ShellClient::setTransient public (it's only private because… | |||||
173 | } | 174 | } | ||
174 | m_compositor = m_display->createCompositor(m_display); | 175 | m_compositor = m_display->createCompositor(m_display); | ||
175 | m_compositor->create(); | 176 | m_compositor->create(); | ||
176 | connect(m_compositor, &CompositorInterface::surfaceCreated, this, | 177 | connect(m_compositor, &CompositorInterface::surfaceCreated, this, | ||
177 | [this] (SurfaceInterface *surface) { | 178 | [this] (SurfaceInterface *surface) { | ||
178 | // check whether we have a Toplevel with the Surface's id | 179 | // check whether we have a Toplevel with the Surface's id | ||
179 | Workspace *ws = Workspace::self(); | 180 | Workspace *ws = Workspace::self(); | ||
180 | if (!ws) { | 181 | if (!ws) { | ||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | |||||
296 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | 297 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | ||
297 | this, [this](KWayland::Server::OutputConfigurationInterface *config) { | 298 | this, [this](KWayland::Server::OutputConfigurationInterface *config) { | ||
298 | kwinApp()->platform()->configurationChangeRequested(config); | 299 | kwinApp()->platform()->configurationChangeRequested(config); | ||
299 | }); | 300 | }); | ||
300 | m_outputManagement->create(); | 301 | m_outputManagement->create(); | ||
301 | 302 | | |||
302 | m_display->createSubCompositor(m_display)->create(); | 303 | m_display->createSubCompositor(m_display)->create(); | ||
303 | 304 | | |||
305 | m_XdgForeign = m_display->createXdgForeignUnstableInterface(m_display); | ||||
306 | m_XdgForeign->create(); | ||||
307 | | ||||
304 | return true; | 308 | return true; | ||
305 | } | 309 | } | ||
306 | 310 | | |||
307 | void WaylandServer::shellClientShown(Toplevel *t) | 311 | void WaylandServer::shellClientShown(Toplevel *t) | ||
308 | { | 312 | { | ||
309 | ShellClient *c = dynamic_cast<ShellClient*>(t); | 313 | ShellClient *c = dynamic_cast<ShellClient*>(t); | ||
310 | if (!c) { | 314 | if (!c) { | ||
311 | qCWarning(KWIN_CORE) << "Failed to cast a Toplevel which is supposed to be a ShellClient to ShellClient"; | 315 | qCWarning(KWIN_CORE) << "Failed to cast a Toplevel which is supposed to be a ShellClient to ShellClient"; | ||
▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines |
Why is the xdgForeign passed to the client?