Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show All 17 Lines | |||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "wayland_server.h" | 20 | #include "wayland_server.h" | ||
21 | #include "x11client.h" | 21 | #include "x11client.h" | ||
22 | #include "platform.h" | 22 | #include "platform.h" | ||
23 | #include "composite.h" | 23 | #include "composite.h" | ||
24 | #include "idle_inhibition.h" | 24 | #include "idle_inhibition.h" | ||
25 | #include "screens.h" | 25 | #include "screens.h" | ||
26 | #include "xdgshellclient.h" | 26 | #include "waylandxdgshellintegration.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | #include "xdgshellclient.h" | ||||
28 | 29 | | |||
29 | // Client | 30 | // Client | ||
30 | #include <KWayland/Client/connection_thread.h> | 31 | #include <KWayland/Client/connection_thread.h> | ||
31 | #include <KWayland/Client/event_queue.h> | 32 | #include <KWayland/Client/event_queue.h> | ||
32 | #include <KWayland/Client/registry.h> | 33 | #include <KWayland/Client/registry.h> | ||
33 | #include <KWayland/Client/compositor.h> | 34 | #include <KWayland/Client/compositor.h> | ||
34 | #include <KWayland/Client/seat.h> | 35 | #include <KWayland/Client/seat.h> | ||
35 | #include <KWayland/Client/datadevicemanager.h> | 36 | #include <KWayland/Client/datadevicemanager.h> | ||
Show All 18 Lines | |||||
54 | #include <KWaylandServer/seat_interface.h> | 55 | #include <KWaylandServer/seat_interface.h> | ||
55 | #include <KWaylandServer/server_decoration_interface.h> | 56 | #include <KWaylandServer/server_decoration_interface.h> | ||
56 | #include <KWaylandServer/server_decoration_palette_interface.h> | 57 | #include <KWaylandServer/server_decoration_palette_interface.h> | ||
57 | #include <KWaylandServer/shadow_interface.h> | 58 | #include <KWaylandServer/shadow_interface.h> | ||
58 | #include <KWaylandServer/subcompositor_interface.h> | 59 | #include <KWaylandServer/subcompositor_interface.h> | ||
59 | #include <KWaylandServer/blur_interface.h> | 60 | #include <KWaylandServer/blur_interface.h> | ||
60 | #include <KWaylandServer/outputmanagement_interface.h> | 61 | #include <KWaylandServer/outputmanagement_interface.h> | ||
61 | #include <KWaylandServer/outputconfiguration_interface.h> | 62 | #include <KWaylandServer/outputconfiguration_interface.h> | ||
62 | #include <KWaylandServer/xdgdecoration_interface.h> | 63 | #include <KWaylandServer/xdgdecoration_v1_interface.h> | ||
63 | #include <KWaylandServer/xdgshell_interface.h> | 64 | #include <KWaylandServer/xdgshell_interface.h> | ||
64 | #include <KWaylandServer/xdgforeign_interface.h> | 65 | #include <KWaylandServer/xdgforeign_interface.h> | ||
65 | #include <KWaylandServer/xdgoutput_interface.h> | 66 | #include <KWaylandServer/xdgoutput_interface.h> | ||
66 | #include <KWaylandServer/keystate_interface.h> | 67 | #include <KWaylandServer/keystate_interface.h> | ||
67 | #include <KWaylandServer/filtered_display.h> | 68 | #include <KWaylandServer/filtered_display.h> | ||
68 | 69 | | |||
69 | // KF | 70 | // KF | ||
70 | #include <KServiceTypeTrader> | 71 | #include <KServiceTypeTrader> | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 136 | { | |||
138 | if (m_display) { | 139 | if (m_display) { | ||
139 | const auto connections = m_display->connections(); | 140 | const auto connections = m_display->connections(); | ||
140 | for (auto it = connections.begin(); it != connections.end(); ++it) { | 141 | for (auto it = connections.begin(); it != connections.end(); ++it) { | ||
141 | (*it)->destroy(); | 142 | (*it)->destroy(); | ||
142 | } | 143 | } | ||
143 | } | 144 | } | ||
144 | } | 145 | } | ||
145 | 146 | | |||
146 | template <class T> | 147 | void WaylandServer::registerShellClient(AbstractClient *client) | ||
147 | void WaylandServer::createSurface(T *surface) | | |||
148 | { | 148 | { | ||
149 | if (!Workspace::self()) { | 149 | if (client->readyForPainting()) { | ||
150 | // it's possible that a Surface gets created before Workspace is created | 150 | emit shellClientAdded(client); | ||
151 | return; | 151 | } else { | ||
152 | connect(client, &AbstractClient::windowShown, this, &WaylandServer::shellClientShown); | ||||
davidedmundson: This can never be true.
It's a protocol error on XDGShell to map before configure | |||||
Well, yeah. I just wanted to keep things as generic as possible. Will remove it. zzag: Well, yeah. I just wanted to keep things as generic as possible. Will remove it. | |||||
Hmm, apol has a patch series that implements zwp_input_panel_surface_v1. Unfortunately, the input method spec allows clients to create input panel surfaces with already attached buffers. Given that we'll need this code path later, I suggest to keep it so we don't have to re-introduce it again. zzag: Hmm, apol has a patch series that implements zwp_input_panel_surface_v1. Unfortunately, the… | |||||
152 | } | 153 | } | ||
154 | m_clients << client; | ||||
155 | } | ||||
156 | | ||||
157 | void WaylandServer::registerXdgToplevelClient(XdgToplevelClient *client) | ||||
158 | { | ||||
159 | // TODO: Find a better way and more generic to install extensions. | ||||
160 | | ||||
161 | SurfaceInterface *surface = client->surface(); | ||||
153 | if (surface->client() == m_xwayland.client) { | 162 | if (surface->client() == m_xwayland.client) { | ||
154 | // skip Xwayland clients, those are created using standard X11 way | | |||
155 | return; | 163 | return; | ||
156 | } | 164 | } | ||
157 | if (surface->client() == m_screenLockerClientConnection) { | 165 | if (surface->client() == m_screenLockerClientConnection) { | ||
158 | ScreenLocker::KSldApp::self()->lockScreenShown(); | 166 | ScreenLocker::KSldApp::self()->lockScreenShown(); | ||
159 | } | 167 | } | ||
160 | XdgShellClient *client = new XdgShellClient(surface); | 168 | | ||
161 | if (ServerSideDecorationInterface *deco = ServerSideDecorationInterface::get(surface->surface())) { | 169 | registerShellClient(client); | ||
162 | client->installServerSideDecoration(deco); | 170 | | ||
163 | } | | |||
164 | auto it = std::find_if(m_plasmaShellSurfaces.begin(), m_plasmaShellSurfaces.end(), | 171 | auto it = std::find_if(m_plasmaShellSurfaces.begin(), m_plasmaShellSurfaces.end(), | ||
165 | [client] (PlasmaShellSurfaceInterface *surface) { | 172 | [surface] (PlasmaShellSurfaceInterface *plasmaSurface) { | ||
166 | return client->surface() == surface->surface(); | 173 | return plasmaSurface->surface() == surface; | ||
167 | } | 174 | } | ||
168 | ); | 175 | ); | ||
169 | if (it != m_plasmaShellSurfaces.end()) { | 176 | if (it != m_plasmaShellSurfaces.end()) { | ||
170 | client->installPlasmaShellSurface(*it); | 177 | client->installPlasmaShellSurface(*it); | ||
171 | m_plasmaShellSurfaces.erase(it); | 178 | m_plasmaShellSurfaces.erase(it); | ||
172 | } | 179 | } | ||
173 | if (auto menu = m_appMenuManager->appMenuForSurface(surface->surface())) { | 180 | if (auto decoration = ServerSideDecorationInterface::get(surface)) { | ||
181 | client->installServerDecoration(decoration); | ||||
182 | } | ||||
183 | if (auto decoration = XdgToplevelDecorationV1Interface::get(client->shellSurface())) { | ||||
184 | client->installXdgDecoration(decoration); | ||||
185 | } | ||||
186 | if (auto menu = m_appMenuManager->appMenuForSurface(surface)) { | ||||
174 | client->installAppMenu(menu); | 187 | client->installAppMenu(menu); | ||
175 | } | 188 | } | ||
176 | if (auto palette = m_paletteManager->paletteForSurface(surface->surface())) { | 189 | if (auto palette = m_paletteManager->paletteForSurface(surface)) { | ||
177 | client->installPalette(palette); | 190 | client->installPalette(palette); | ||
178 | } | 191 | } | ||
179 | m_clients << client; | | |||
180 | if (client->readyForPainting()) { | | |||
181 | emit shellClientAdded(client); | | |||
182 | } else { | | |||
183 | connect(client, &XdgShellClient::windowShown, this, &WaylandServer::shellClientShown); | | |||
184 | } | | |||
185 | 192 | | |||
186 | //not directly connected as the connection is tied to client instead of this | 193 | connect(m_XdgForeign, &XdgForeignInterface::transientChanged, client, [this](SurfaceInterface *child) { | ||
187 | connect(m_XdgForeign, &KWaylandServer::XdgForeignInterface::transientChanged, client, [this](KWaylandServer::SurfaceInterface *child) { | | |||
188 | emit foreignTransientChanged(child); | 194 | emit foreignTransientChanged(child); | ||
189 | }); | 195 | }); | ||
190 | } | 196 | } | ||
191 | 197 | | |||
198 | void WaylandServer::registerXdgGenericClient(AbstractClient *client) | ||||
199 | { | ||||
200 | XdgToplevelClient *toplevelClient = qobject_cast<XdgToplevelClient *>(client); | ||||
201 | if (toplevelClient) { | ||||
202 | registerXdgToplevelClient(toplevelClient); | ||||
203 | return; | ||||
204 | } | ||||
205 | XdgPopupClient *popupClient = qobject_cast<XdgPopupClient *>(client); | ||||
206 | if (popupClient) { | ||||
207 | registerShellClient(popupClient); | ||||
208 | return; | ||||
209 | } | ||||
210 | qCDebug(KWIN_CORE) << "Received invalid xdg client:" << client->surface(); | ||||
211 | } | ||||
212 | | ||||
192 | class KWinDisplay : public KWaylandServer::FilteredDisplay | 213 | class KWinDisplay : public KWaylandServer::FilteredDisplay | ||
193 | { | 214 | { | ||
194 | public: | 215 | public: | ||
195 | KWinDisplay(QObject *parent) | 216 | KWinDisplay(QObject *parent) | ||
196 | : KWaylandServer::FilteredDisplay(parent) | 217 | : KWaylandServer::FilteredDisplay(parent) | ||
197 | {} | 218 | {} | ||
198 | 219 | | |||
199 | static QByteArray sha256(const QString &fileName) | 220 | static QByteArray sha256(const QString &fileName) | ||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Line(s) | 318 | [this] (SurfaceInterface *surface) { | |||
311 | if (Toplevel *t = ws->findToplevel(check)) { | 332 | if (Toplevel *t = ws->findToplevel(check)) { | ||
312 | t->setSurface(surface); | 333 | t->setSurface(surface); | ||
313 | } | 334 | } | ||
314 | } | 335 | } | ||
315 | ); | 336 | ); | ||
316 | 337 | | |||
317 | m_tabletManager = m_display->createTabletManagerInterface(m_display); | 338 | m_tabletManager = m_display->createTabletManagerInterface(m_display); | ||
318 | 339 | | |||
319 | m_xdgShell = m_display->createXdgShell(XdgShellInterfaceVersion::Stable, m_display); | 340 | auto shellIntegration = new WaylandXdgShellIntegration(this); | ||
320 | m_xdgShell->create(); | 341 | connect(shellIntegration, &WaylandXdgShellIntegration::clientCreated, | ||
321 | connect(m_xdgShell, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface<XdgShellSurfaceInterface>); | 342 | this, &WaylandServer::registerXdgGenericClient); | ||
322 | connect(m_xdgShell, &XdgShellInterface::xdgPopupCreated, this, &WaylandServer::createSurface<XdgShellPopupInterface>); | 343 | | ||
323 | 344 | m_xdgDecorationManagerV1 = m_display->createXdgDecorationManagerV1(m_display); | |||
324 | m_xdgDecorationManager = m_display->createXdgDecorationManager(m_xdgShell, m_display); | 345 | connect(m_xdgDecorationManagerV1, &XdgDecorationManagerV1Interface::decorationCreated, this, | ||
325 | m_xdgDecorationManager->create(); | 346 | [this](XdgToplevelDecorationV1Interface *decoration) { | ||
326 | connect(m_xdgDecorationManager, &XdgDecorationManagerInterface::xdgDecorationInterfaceCreated, this, [this] (XdgDecorationInterface *deco) { | 347 | if (XdgToplevelClient *toplevel = findXdgToplevelClient(decoration->toplevel()->surface())) { | ||
327 | if (XdgShellClient *client = findXdgShellClient(deco->surface()->surface())) { | 348 | toplevel->installXdgDecoration(decoration); | ||
328 | client->installXdgDecoration(deco); | | |||
329 | } | 349 | } | ||
330 | }); | 350 | } | ||
351 | ); | ||||
331 | 352 | | |||
332 | m_display->createShm(); | 353 | m_display->createShm(); | ||
333 | m_seat = m_display->createSeat(m_display); | 354 | m_seat = m_display->createSeat(m_display); | ||
334 | m_seat->create(); | 355 | m_seat->create(); | ||
335 | m_display->createPointerGestures(PointerGesturesInterfaceVersion::UnstableV1, m_display)->create(); | 356 | m_display->createPointerGestures(PointerGesturesInterfaceVersion::UnstableV1, m_display)->create(); | ||
336 | m_display->createPointerConstraints(PointerConstraintsInterfaceVersion::UnstableV1, m_display)->create(); | 357 | m_display->createPointerConstraints(PointerConstraintsInterfaceVersion::UnstableV1, m_display)->create(); | ||
337 | m_dataDeviceManager = m_display->createDataDeviceManager(m_display); | 358 | m_dataDeviceManager = m_display->createDataDeviceManager(m_display); | ||
338 | m_dataDeviceManager->create(); | 359 | m_dataDeviceManager->create(); | ||
339 | m_idle = m_display->createIdle(m_display); | 360 | m_idle = m_display->createIdle(m_display); | ||
340 | m_idle->create(); | 361 | m_idle->create(); | ||
341 | auto idleInhibition = new IdleInhibition(m_idle); | 362 | auto idleInhibition = new IdleInhibition(m_idle); | ||
342 | connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerClient); | 363 | connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerClient); | ||
343 | m_display->createIdleInhibitManager(IdleInhibitManagerInterfaceVersion::UnstableV1, m_display)->create(); | 364 | m_display->createIdleInhibitManager(IdleInhibitManagerInterfaceVersion::UnstableV1, m_display)->create(); | ||
344 | m_plasmaShell = m_display->createPlasmaShell(m_display); | 365 | m_plasmaShell = m_display->createPlasmaShell(m_display); | ||
345 | m_plasmaShell->create(); | 366 | m_plasmaShell->create(); | ||
346 | connect(m_plasmaShell, &PlasmaShellInterface::surfaceCreated, | 367 | connect(m_plasmaShell, &PlasmaShellInterface::surfaceCreated, | ||
347 | [this] (PlasmaShellSurfaceInterface *surface) { | 368 | [this] (PlasmaShellSurfaceInterface *surface) { | ||
348 | if (XdgShellClient *client = findXdgShellClient(surface->surface())) { | 369 | if (XdgToplevelClient *client = findXdgToplevelClient(surface->surface())) { | ||
349 | client->installPlasmaShellSurface(surface); | 370 | client->installPlasmaShellSurface(surface); | ||
350 | } else { | 371 | return; | ||
351 | m_plasmaShellSurfaces << surface; | | |||
352 | connect(surface, &QObject::destroyed, this, | | |||
353 | [this, surface] { | | |||
354 | m_plasmaShellSurfaces.removeOne(surface); | | |||
355 | } | | |||
356 | ); | | |||
357 | } | 372 | } | ||
373 | m_plasmaShellSurfaces.append(surface); | ||||
374 | connect(surface, &QObject::destroyed, this, [this, surface] { | ||||
375 | m_plasmaShellSurfaces.removeOne(surface); | ||||
376 | }); | ||||
358 | } | 377 | } | ||
359 | ); | 378 | ); | ||
360 | m_appMenuManager = m_display->createAppMenuManagerInterface(m_display); | 379 | m_appMenuManager = m_display->createAppMenuManagerInterface(m_display); | ||
361 | m_appMenuManager->create(); | 380 | m_appMenuManager->create(); | ||
362 | connect(m_appMenuManager, &AppMenuManagerInterface::appMenuCreated, | 381 | connect(m_appMenuManager, &AppMenuManagerInterface::appMenuCreated, | ||
363 | [this] (AppMenuInterface *appMenu) { | 382 | [this] (AppMenuInterface *appMenu) { | ||
364 | if (XdgShellClient *client = findXdgShellClient(appMenu->surface())) { | 383 | if (XdgToplevelClient *client = findXdgToplevelClient(appMenu->surface())) { | ||
365 | client->installAppMenu(appMenu); | 384 | client->installAppMenu(appMenu); | ||
366 | } | 385 | } | ||
367 | } | 386 | } | ||
368 | ); | 387 | ); | ||
369 | m_paletteManager = m_display->createServerSideDecorationPaletteManager(m_display); | 388 | m_paletteManager = m_display->createServerSideDecorationPaletteManager(m_display); | ||
370 | m_paletteManager->create(); | 389 | m_paletteManager->create(); | ||
371 | connect(m_paletteManager, &ServerSideDecorationPaletteManagerInterface::paletteCreated, | 390 | connect(m_paletteManager, &ServerSideDecorationPaletteManagerInterface::paletteCreated, | ||
372 | [this] (ServerSideDecorationPaletteInterface *palette) { | 391 | [this] (ServerSideDecorationPaletteInterface *palette) { | ||
373 | if (XdgShellClient *client = findXdgShellClient(palette->surface())) { | 392 | if (XdgToplevelClient *client = findXdgToplevelClient(palette->surface())) { | ||
374 | client->installPalette(palette); | 393 | client->installPalette(palette); | ||
375 | } | 394 | } | ||
376 | } | 395 | } | ||
377 | ); | 396 | ); | ||
378 | 397 | | |||
379 | m_windowManagement = m_display->createPlasmaWindowManagement(m_display); | 398 | m_windowManagement = m_display->createPlasmaWindowManagement(m_display); | ||
380 | m_windowManagement->create(); | 399 | m_windowManagement->create(); | ||
381 | m_windowManagement->setShowingDesktopState(PlasmaWindowManagementInterface::ShowingDesktopState::Disabled); | 400 | m_windowManagement->setShowingDesktopState(PlasmaWindowManagementInterface::ShowingDesktopState::Disabled); | ||
Show All 27 Lines | |||||
409 | 428 | | |||
410 | auto shadowManager = m_display->createShadowManager(m_display); | 429 | auto shadowManager = m_display->createShadowManager(m_display); | ||
411 | shadowManager->create(); | 430 | shadowManager->create(); | ||
412 | 431 | | |||
413 | m_display->createDpmsManager(m_display)->create(); | 432 | m_display->createDpmsManager(m_display)->create(); | ||
414 | 433 | | |||
415 | m_decorationManager = m_display->createServerSideDecorationManager(m_display); | 434 | m_decorationManager = m_display->createServerSideDecorationManager(m_display); | ||
416 | connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, | 435 | connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, | ||
417 | [this] (ServerSideDecorationInterface *deco) { | 436 | [this] (ServerSideDecorationInterface *decoration) { | ||
418 | if (XdgShellClient *c = findXdgShellClient(deco->surface())) { | 437 | if (XdgToplevelClient *client = findXdgToplevelClient(decoration->surface())) { | ||
419 | c->installServerSideDecoration(deco); | 438 | client->installServerDecoration(decoration); | ||
420 | } | 439 | } | ||
421 | connect(deco, &ServerSideDecorationInterface::modeRequested, this, | 440 | connect(decoration, &ServerSideDecorationInterface::modeRequested, this, | ||
422 | [deco] (ServerSideDecorationManagerInterface::Mode mode) { | 441 | [decoration] (ServerSideDecorationManagerInterface::Mode mode) { | ||
423 | // always acknowledge the requested mode | 442 | // always acknowledge the requested mode | ||
424 | deco->setMode(mode); | 443 | decoration->setMode(mode); | ||
425 | } | 444 | } | ||
426 | ); | 445 | ); | ||
427 | } | 446 | } | ||
428 | ); | 447 | ); | ||
429 | m_decorationManager->create(); | 448 | m_decorationManager->create(); | ||
430 | 449 | | |||
431 | m_outputManagement = m_display->createOutputManagement(m_display); | 450 | m_outputManagement = m_display->createOutputManagement(m_display); | ||
432 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | 451 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | ||
Show All 25 Lines | 472 | { | |||
458 | return m_linuxDmabuf; | 477 | return m_linuxDmabuf; | ||
459 | } | 478 | } | ||
460 | 479 | | |||
461 | SurfaceInterface *WaylandServer::findForeignTransientForSurface(SurfaceInterface *surface) | 480 | SurfaceInterface *WaylandServer::findForeignTransientForSurface(SurfaceInterface *surface) | ||
462 | { | 481 | { | ||
463 | return m_XdgForeign->transientFor(surface); | 482 | return m_XdgForeign->transientFor(surface); | ||
464 | } | 483 | } | ||
465 | 484 | | |||
466 | void WaylandServer::shellClientShown(Toplevel *t) | 485 | void WaylandServer::shellClientShown(Toplevel *toplevel) | ||
467 | { | 486 | { | ||
468 | XdgShellClient *c = dynamic_cast<XdgShellClient *>(t); | 487 | AbstractClient *client = qobject_cast<AbstractClient *>(toplevel); | ||
469 | if (!c) { | 488 | if (!client) { | ||
470 | qCWarning(KWIN_CORE) << "Failed to cast a Toplevel which is supposed to be a XdgShellClient to XdgShellClient"; | 489 | qCWarning(KWIN_CORE) << "Failed to cast a Toplevel which is supposed to be an AbstractClient to AbstractClient"; | ||
471 | return; | 490 | return; | ||
472 | } | 491 | } | ||
473 | disconnect(c, &XdgShellClient::windowShown, this, &WaylandServer::shellClientShown); | 492 | disconnect(client, &AbstractClient::windowShown, this, &WaylandServer::shellClientShown); | ||
474 | emit shellClientAdded(c); | 493 | emit shellClientAdded(client); | ||
475 | } | 494 | } | ||
476 | 495 | | |||
477 | void WaylandServer::initWorkspace() | 496 | void WaylandServer::initWorkspace() | ||
478 | { | 497 | { | ||
479 | VirtualDesktopManager::self()->setVirtualDesktopManagement(m_virtualDesktopManagement); | 498 | VirtualDesktopManager::self()->setVirtualDesktopManagement(m_virtualDesktopManagement); | ||
480 | 499 | | |||
481 | if (m_windowManagement) { | 500 | if (m_windowManagement) { | ||
482 | connect(workspace(), &Workspace::showingDesktopChanged, this, | 501 | connect(workspace(), &Workspace::showingDesktopChanged, this, | ||
▲ Show 20 Lines • Show All 261 Lines • ▼ Show 20 Line(s) | 762 | if (!surface) { | |||
744 | return nullptr; | 763 | return nullptr; | ||
745 | } | 764 | } | ||
746 | if (AbstractClient *c = findClientInList(m_clients, surface)) { | 765 | if (AbstractClient *c = findClientInList(m_clients, surface)) { | ||
747 | return c; | 766 | return c; | ||
748 | } | 767 | } | ||
749 | return nullptr; | 768 | return nullptr; | ||
750 | } | 769 | } | ||
751 | 770 | | |||
752 | XdgShellClient *WaylandServer::findXdgShellClient(SurfaceInterface *surface) const | 771 | XdgToplevelClient *WaylandServer::findXdgToplevelClient(SurfaceInterface *surface) const | ||
753 | { | 772 | { | ||
754 | return qobject_cast<XdgShellClient *>(findClient(surface)); | 773 | return qobject_cast<XdgToplevelClient *>(findClient(surface)); | ||
755 | } | 774 | } | ||
756 | 775 | | |||
757 | quint32 WaylandServer::createWindowId(SurfaceInterface *surface) | 776 | quint32 WaylandServer::createWindowId(SurfaceInterface *surface) | ||
758 | { | 777 | { | ||
759 | auto it = m_clientIds.constFind(surface->client()); | 778 | auto it = m_clientIds.constFind(surface->client()); | ||
760 | quint16 clientId = 0; | 779 | quint16 clientId = 0; | ||
761 | if (it != m_clientIds.constEnd()) { | 780 | if (it != m_clientIds.constEnd()) { | ||
762 | clientId = it.value(); | 781 | clientId = it.value(); | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |
This can never be true.
It's a protocol error on XDGShell to map before configure