Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show All 30 Lines | |||||
31 | #include <KWayland/Client/event_queue.h> | 31 | #include <KWayland/Client/event_queue.h> | ||
32 | #include <KWayland/Client/registry.h> | 32 | #include <KWayland/Client/registry.h> | ||
33 | #include <KWayland/Client/compositor.h> | 33 | #include <KWayland/Client/compositor.h> | ||
34 | #include <KWayland/Client/seat.h> | 34 | #include <KWayland/Client/seat.h> | ||
35 | #include <KWayland/Client/datadevicemanager.h> | 35 | #include <KWayland/Client/datadevicemanager.h> | ||
36 | #include <KWayland/Client/shm_pool.h> | 36 | #include <KWayland/Client/shm_pool.h> | ||
37 | #include <KWayland/Client/surface.h> | 37 | #include <KWayland/Client/surface.h> | ||
38 | // Server | 38 | // Server | ||
39 | #include <KWayland/Server/appmenu_interface.h> | 39 | #include <KWaylandServer/appmenu_interface.h> | ||
40 | #include <KWayland/Server/compositor_interface.h> | 40 | #include <KWaylandServer/compositor_interface.h> | ||
41 | #include <KWayland/Server/datadevicemanager_interface.h> | 41 | #include <KWaylandServer/datadevicemanager_interface.h> | ||
42 | #include <KWayland/Server/datasource_interface.h> | 42 | #include <KWaylandServer/datasource_interface.h> | ||
43 | #include <KWayland/Server/display.h> | 43 | #include <KWaylandServer/display.h> | ||
44 | #include <KWayland/Server/dpms_interface.h> | 44 | #include <KWaylandServer/dpms_interface.h> | ||
45 | #include <KWayland/Server/idle_interface.h> | 45 | #include <KWaylandServer/idle_interface.h> | ||
46 | #include <KWayland/Server/idleinhibit_interface.h> | 46 | #include <KWaylandServer/idleinhibit_interface.h> | ||
47 | #include <KWayland/Server/linuxdmabuf_v1_interface.h> | 47 | #include <KWaylandServer/linuxdmabuf_v1_interface.h> | ||
48 | #include <KWayland/Server/output_interface.h> | 48 | #include <KWaylandServer/output_interface.h> | ||
49 | #include <KWayland/Server/plasmashell_interface.h> | 49 | #include <KWaylandServer/plasmashell_interface.h> | ||
50 | #include <KWayland/Server/plasmavirtualdesktop_interface.h> | 50 | #include <KWaylandServer/plasmavirtualdesktop_interface.h> | ||
51 | #include <KWayland/Server/plasmawindowmanagement_interface.h> | 51 | #include <KWaylandServer/plasmawindowmanagement_interface.h> | ||
52 | #include <KWayland/Server/pointerconstraints_interface.h> | 52 | #include <KWaylandServer/pointerconstraints_interface.h> | ||
53 | #include <KWayland/Server/pointergestures_interface.h> | 53 | #include <KWaylandServer/pointergestures_interface.h> | ||
54 | #include <KWayland/Server/qtsurfaceextension_interface.h> | 54 | #include <KWaylandServer/qtsurfaceextension_interface.h> | ||
55 | #include <KWayland/Server/seat_interface.h> | 55 | #include <KWaylandServer/seat_interface.h> | ||
56 | #include <KWayland/Server/server_decoration_interface.h> | 56 | #include <KWaylandServer/server_decoration_interface.h> | ||
57 | #include <KWayland/Server/server_decoration_palette_interface.h> | 57 | #include <KWaylandServer/server_decoration_palette_interface.h> | ||
58 | #include <KWayland/Server/shadow_interface.h> | 58 | #include <KWaylandServer/shadow_interface.h> | ||
59 | #include <KWayland/Server/subcompositor_interface.h> | 59 | #include <KWaylandServer/subcompositor_interface.h> | ||
60 | #include <KWayland/Server/blur_interface.h> | 60 | #include <KWaylandServer/blur_interface.h> | ||
61 | #include <KWayland/Server/outputmanagement_interface.h> | 61 | #include <KWaylandServer/outputmanagement_interface.h> | ||
62 | #include <KWayland/Server/outputconfiguration_interface.h> | 62 | #include <KWaylandServer/outputconfiguration_interface.h> | ||
63 | #include <KWayland/Server/xdgdecoration_interface.h> | 63 | #include <KWaylandServer/xdgdecoration_interface.h> | ||
64 | #include <KWayland/Server/xdgshell_interface.h> | 64 | #include <KWaylandServer/xdgshell_interface.h> | ||
65 | #include <KWayland/Server/xdgforeign_interface.h> | 65 | #include <KWaylandServer/xdgforeign_interface.h> | ||
66 | #include <KWayland/Server/xdgoutput_interface.h> | 66 | #include <KWaylandServer/xdgoutput_interface.h> | ||
67 | #include <KWayland/Server/keystate_interface.h> | 67 | #include <KWaylandServer/keystate_interface.h> | ||
68 | #include <KWayland/Server/filtered_display.h> | 68 | #include <KWaylandServer/filtered_display.h> | ||
69 | 69 | | |||
70 | // KF | 70 | // KF | ||
71 | #include <KServiceTypeTrader> | 71 | #include <KServiceTypeTrader> | ||
72 | 72 | | |||
73 | // Qt | 73 | // Qt | ||
74 | #include <QCryptographicHash> | 74 | #include <QCryptographicHash> | ||
75 | #include <QDir> | 75 | #include <QDir> | ||
76 | #include <QFileInfo> | 76 | #include <QFileInfo> | ||
77 | #include <QThread> | 77 | #include <QThread> | ||
78 | #include <QWindow> | 78 | #include <QWindow> | ||
79 | 79 | | |||
80 | // system | 80 | // system | ||
81 | #include <sys/types.h> | 81 | #include <sys/types.h> | ||
82 | #include <sys/socket.h> | 82 | #include <sys/socket.h> | ||
83 | #include <unistd.h> | 83 | #include <unistd.h> | ||
84 | 84 | | |||
85 | //screenlocker | 85 | //screenlocker | ||
86 | #include <KScreenLocker/KsldApp> | 86 | #include <KScreenLocker/KsldApp> | ||
87 | 87 | | |||
88 | using namespace KWayland::Server; | 88 | using namespace KWaylandServer; | ||
89 | 89 | | |||
90 | namespace KWin | 90 | namespace KWin | ||
91 | { | 91 | { | ||
92 | 92 | | |||
93 | KWIN_SINGLETON_FACTORY(WaylandServer) | 93 | KWIN_SINGLETON_FACTORY(WaylandServer) | ||
94 | 94 | | |||
95 | WaylandServer::WaylandServer(QObject *parent) | 95 | WaylandServer::WaylandServer(QObject *parent) | ||
96 | : QObject(parent) | 96 | : QObject(parent) | ||
97 | { | 97 | { | ||
98 | qRegisterMetaType<KWayland::Server::OutputInterface::DpmsMode>(); | 98 | qRegisterMetaType<KWaylandServer::OutputInterface::DpmsMode>(); | ||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | WaylandServer::~WaylandServer() | 101 | WaylandServer::~WaylandServer() | ||
102 | { | 102 | { | ||
103 | destroyInputMethodConnection(); | 103 | destroyInputMethodConnection(); | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | void WaylandServer::destroyInternalConnection() | 106 | void WaylandServer::destroyInternalConnection() | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 149 | { | |||
180 | m_clients << client; | 180 | m_clients << client; | ||
181 | if (client->readyForPainting()) { | 181 | if (client->readyForPainting()) { | ||
182 | emit shellClientAdded(client); | 182 | emit shellClientAdded(client); | ||
183 | } else { | 183 | } else { | ||
184 | connect(client, &XdgShellClient::windowShown, this, &WaylandServer::shellClientShown); | 184 | connect(client, &XdgShellClient::windowShown, this, &WaylandServer::shellClientShown); | ||
185 | } | 185 | } | ||
186 | 186 | | |||
187 | //not directly connected as the connection is tied to client instead of this | 187 | //not directly connected as the connection is tied to client instead of this | ||
188 | connect(m_XdgForeign, &KWayland::Server::XdgForeignInterface::transientChanged, client, [this](KWayland::Server::SurfaceInterface *child) { | 188 | connect(m_XdgForeign, &KWaylandServer::XdgForeignInterface::transientChanged, client, [this](KWaylandServer::SurfaceInterface *child) { | ||
189 | emit foreignTransientChanged(child); | 189 | emit foreignTransientChanged(child); | ||
190 | }); | 190 | }); | ||
191 | } | 191 | } | ||
192 | 192 | | |||
193 | class KWinDisplay : public KWayland::Server::FilteredDisplay | 193 | class KWinDisplay : public KWaylandServer::FilteredDisplay | ||
194 | { | 194 | { | ||
195 | public: | 195 | public: | ||
196 | KWinDisplay(QObject *parent) | 196 | KWinDisplay(QObject *parent) | ||
197 | : KWayland::Server::FilteredDisplay(parent) | 197 | : KWaylandServer::FilteredDisplay(parent) | ||
198 | {} | 198 | {} | ||
199 | 199 | | |||
200 | static QByteArray sha256(const QString &fileName) | 200 | static QByteArray sha256(const QString &fileName) | ||
201 | { | 201 | { | ||
202 | QFile f(fileName); | 202 | QFile f(fileName); | ||
203 | if (f.open(QFile::ReadOnly)) { | 203 | if (f.open(QFile::ReadOnly)) { | ||
204 | QCryptographicHash hash(QCryptographicHash::Sha256); | 204 | QCryptographicHash hash(QCryptographicHash::Sha256); | ||
205 | if (hash.addData(&f)) { | 205 | if (hash.addData(&f)) { | ||
206 | return hash.result(); | 206 | return hash.result(); | ||
207 | } | 207 | } | ||
208 | } | 208 | } | ||
209 | return QByteArray(); | 209 | return QByteArray(); | ||
210 | } | 210 | } | ||
211 | 211 | | |||
212 | bool isTrustedOrigin(KWayland::Server::ClientConnection *client) const { | 212 | bool isTrustedOrigin(KWaylandServer::ClientConnection *client) const { | ||
213 | const auto fullPathSha = sha256(client->executablePath()); | 213 | const auto fullPathSha = sha256(client->executablePath()); | ||
214 | const auto localSha = sha256(QLatin1String("/proc/") + QString::number(client->processId()) + QLatin1String("/exe")); | 214 | const auto localSha = sha256(QLatin1String("/proc/") + QString::number(client->processId()) + QLatin1String("/exe")); | ||
215 | const bool trusted = !localSha.isEmpty() && fullPathSha == localSha; | 215 | const bool trusted = !localSha.isEmpty() && fullPathSha == localSha; | ||
216 | 216 | | |||
217 | if (!trusted) { | 217 | if (!trusted) { | ||
218 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | 218 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | ||
219 | } | 219 | } | ||
220 | 220 | | |||
221 | return trusted; | 221 | return trusted; | ||
222 | } | 222 | } | ||
223 | 223 | | |||
224 | QStringList fetchRequestedInterfaces(KWayland::Server::ClientConnection *client) const { | 224 | QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { | ||
225 | const auto serviceQuery = QStringLiteral("exist Exec and exist [X-KDE-Wayland-Interfaces] and '%1' =~ Exec").arg(client->executablePath()); | 225 | const auto serviceQuery = QStringLiteral("exist Exec and exist [X-KDE-Wayland-Interfaces] and '%1' =~ Exec").arg(client->executablePath()); | ||
226 | const auto servicesFound = KServiceTypeTrader::self()->query(QStringLiteral("Application"), serviceQuery); | 226 | const auto servicesFound = KServiceTypeTrader::self()->query(QStringLiteral("Application"), serviceQuery); | ||
227 | 227 | | |||
228 | if (servicesFound.isEmpty()) { | 228 | if (servicesFound.isEmpty()) { | ||
229 | qCDebug(KWIN_CORE) << "Could not find the desktop file for" << client->executablePath(); | 229 | qCDebug(KWIN_CORE) << "Could not find the desktop file for" << client->executablePath(); | ||
230 | return {}; | 230 | return {}; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | 233 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | ||
234 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | 234 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | ||
235 | return interfaces; | 235 | return interfaces; | ||
236 | } | 236 | } | ||
237 | 237 | | |||
238 | QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | 238 | QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | ||
239 | 239 | | |||
240 | bool allowInterface(KWayland::Server::ClientConnection *client, const QByteArray &interfaceName) override { | 240 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | ||
241 | if (client->processId() == getpid()) { | 241 | if (client->processId() == getpid()) { | ||
242 | return true; | 242 | return true; | ||
243 | } | 243 | } | ||
244 | 244 | | |||
245 | if (!interfacesBlackList.contains(interfaceName)) { | 245 | if (!interfacesBlackList.contains(interfaceName)) { | ||
246 | return true; | 246 | return true; | ||
247 | } | 247 | } | ||
248 | 248 | | |||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 422 | connect(deco, &ServerSideDecorationInterface::modeRequested, this, | |||
426 | } | 426 | } | ||
427 | ); | 427 | ); | ||
428 | } | 428 | } | ||
429 | ); | 429 | ); | ||
430 | m_decorationManager->create(); | 430 | m_decorationManager->create(); | ||
431 | 431 | | |||
432 | m_outputManagement = m_display->createOutputManagement(m_display); | 432 | m_outputManagement = m_display->createOutputManagement(m_display); | ||
433 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | 433 | connect(m_outputManagement, &OutputManagementInterface::configurationChangeRequested, | ||
434 | this, [](KWayland::Server::OutputConfigurationInterface *config) { | 434 | this, [](KWaylandServer::OutputConfigurationInterface *config) { | ||
435 | kwinApp()->platform()->requestOutputsChange(config); | 435 | kwinApp()->platform()->requestOutputsChange(config); | ||
436 | }); | 436 | }); | ||
437 | m_outputManagement->create(); | 437 | m_outputManagement->create(); | ||
438 | 438 | | |||
439 | m_xdgOutputManager = m_display->createXdgOutputManager(m_display); | 439 | m_xdgOutputManager = m_display->createXdgOutputManager(m_display); | ||
440 | m_xdgOutputManager->create(); | 440 | m_xdgOutputManager->create(); | ||
441 | 441 | | |||
442 | m_display->createSubCompositor(m_display)->create(); | 442 | m_display->createSubCompositor(m_display)->create(); | ||
443 | 443 | | |||
444 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | 444 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | ||
445 | m_XdgForeign->create(); | 445 | m_XdgForeign->create(); | ||
446 | 446 | | |||
447 | m_keyState = m_display->createKeyStateInterface(m_display); | 447 | m_keyState = m_display->createKeyStateInterface(m_display); | ||
448 | m_keyState->create(); | 448 | m_keyState->create(); | ||
449 | 449 | | |||
450 | return true; | 450 | return true; | ||
451 | } | 451 | } | ||
452 | 452 | | |||
453 | KWayland::Server::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() | 453 | KWaylandServer::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() | ||
454 | { | 454 | { | ||
455 | if (!m_linuxDmabuf) { | 455 | if (!m_linuxDmabuf) { | ||
456 | m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); | 456 | m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); | ||
457 | m_linuxDmabuf->create(); | 457 | m_linuxDmabuf->create(); | ||
458 | } | 458 | } | ||
459 | return m_linuxDmabuf; | 459 | return m_linuxDmabuf; | ||
460 | } | 460 | } | ||
461 | 461 | | |||
Show All 15 Lines | |||||
477 | 477 | | |||
478 | void WaylandServer::initWorkspace() | 478 | void WaylandServer::initWorkspace() | ||
479 | { | 479 | { | ||
480 | VirtualDesktopManager::self()->setVirtualDesktopManagement(m_virtualDesktopManagement); | 480 | VirtualDesktopManager::self()->setVirtualDesktopManagement(m_virtualDesktopManagement); | ||
481 | 481 | | |||
482 | if (m_windowManagement) { | 482 | if (m_windowManagement) { | ||
483 | connect(workspace(), &Workspace::showingDesktopChanged, this, | 483 | connect(workspace(), &Workspace::showingDesktopChanged, this, | ||
484 | [this] (bool set) { | 484 | [this] (bool set) { | ||
485 | using namespace KWayland::Server; | 485 | using namespace KWaylandServer; | ||
486 | m_windowManagement->setShowingDesktopState(set ? | 486 | m_windowManagement->setShowingDesktopState(set ? | ||
487 | PlasmaWindowManagementInterface::ShowingDesktopState::Enabled : | 487 | PlasmaWindowManagementInterface::ShowingDesktopState::Enabled : | ||
488 | PlasmaWindowManagementInterface::ShowingDesktopState::Disabled | 488 | PlasmaWindowManagementInterface::ShowingDesktopState::Disabled | ||
489 | ); | 489 | ); | ||
490 | } | 490 | } | ||
491 | ); | 491 | ); | ||
492 | 492 | | |||
493 | connect(workspace(), &Workspace::workspaceInitialized, this, [this] { | 493 | connect(workspace(), &Workspace::workspaceInitialized, this, [this] { | ||
Show All 38 Lines | 528 | [this, screenLockerApp] () { | |||
532 | } | 532 | } | ||
533 | int clientFd = createScreenLockerConnection(); | 533 | int clientFd = createScreenLockerConnection(); | ||
534 | if (clientFd < 0) { | 534 | if (clientFd < 0) { | ||
535 | return; | 535 | return; | ||
536 | } | 536 | } | ||
537 | ScreenLocker::KSldApp::self()->setWaylandFd(clientFd); | 537 | ScreenLocker::KSldApp::self()->setWaylandFd(clientFd); | ||
538 | 538 | | |||
539 | for (auto *seat : m_display->seats()) { | 539 | for (auto *seat : m_display->seats()) { | ||
540 | connect(seat, &KWayland::Server::SeatInterface::timestampChanged, | 540 | connect(seat, &KWaylandServer::SeatInterface::timestampChanged, | ||
541 | screenLockerApp, &ScreenLocker::KSldApp::userActivity); | 541 | screenLockerApp, &ScreenLocker::KSldApp::userActivity); | ||
542 | } | 542 | } | ||
543 | } | 543 | } | ||
544 | ); | 544 | ); | ||
545 | 545 | | |||
546 | connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::unlocked, this, | 546 | connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::unlocked, this, | ||
547 | [this, screenLockerApp] () { | 547 | [this, screenLockerApp] () { | ||
548 | if (m_screenLockerClientConnection) { | 548 | if (m_screenLockerClientConnection) { | ||
549 | m_screenLockerClientConnection->destroy(); | 549 | m_screenLockerClientConnection->destroy(); | ||
550 | delete m_screenLockerClientConnection; | 550 | delete m_screenLockerClientConnection; | ||
551 | m_screenLockerClientConnection = nullptr; | 551 | m_screenLockerClientConnection = nullptr; | ||
552 | } | 552 | } | ||
553 | 553 | | |||
554 | for (auto *seat : m_display->seats()) { | 554 | for (auto *seat : m_display->seats()) { | ||
555 | disconnect(seat, &KWayland::Server::SeatInterface::timestampChanged, | 555 | disconnect(seat, &KWaylandServer::SeatInterface::timestampChanged, | ||
556 | screenLockerApp, &ScreenLocker::KSldApp::userActivity); | 556 | screenLockerApp, &ScreenLocker::KSldApp::userActivity); | ||
557 | } | 557 | } | ||
558 | ScreenLocker::KSldApp::self()->setWaylandFd(-1); | 558 | ScreenLocker::KSldApp::self()->setWaylandFd(-1); | ||
559 | } | 559 | } | ||
560 | ); | 560 | ); | ||
561 | 561 | | |||
562 | if (m_initFlags.testFlag(InitializationFlag::LockScreen)) { | 562 | if (m_initFlags.testFlag(InitializationFlag::LockScreen)) { | ||
563 | ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); | 563 | ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); | ||
Show All 16 Lines | |||||
580 | 580 | | |||
581 | int WaylandServer::createScreenLockerConnection() | 581 | int WaylandServer::createScreenLockerConnection() | ||
582 | { | 582 | { | ||
583 | const auto socket = createConnection(); | 583 | const auto socket = createConnection(); | ||
584 | if (!socket.connection) { | 584 | if (!socket.connection) { | ||
585 | return -1; | 585 | return -1; | ||
586 | } | 586 | } | ||
587 | m_screenLockerClientConnection = socket.connection; | 587 | m_screenLockerClientConnection = socket.connection; | ||
588 | connect(m_screenLockerClientConnection, &KWayland::Server::ClientConnection::disconnected, | 588 | connect(m_screenLockerClientConnection, &KWaylandServer::ClientConnection::disconnected, | ||
589 | this, [this] { m_screenLockerClientConnection = nullptr; }); | 589 | this, [this] { m_screenLockerClientConnection = nullptr; }); | ||
590 | return socket.fd; | 590 | return socket.fd; | ||
591 | } | 591 | } | ||
592 | 592 | | |||
593 | int WaylandServer::createXWaylandConnection() | 593 | int WaylandServer::createXWaylandConnection() | ||
594 | { | 594 | { | ||
595 | const auto socket = createConnection(); | 595 | const auto socket = createConnection(); | ||
596 | if (!socket.connection) { | 596 | if (!socket.connection) { | ||
597 | return -1; | 597 | return -1; | ||
598 | } | 598 | } | ||
599 | m_xwayland.client = socket.connection; | 599 | m_xwayland.client = socket.connection; | ||
600 | m_xwayland.destroyConnection = connect(m_xwayland.client, &KWayland::Server::ClientConnection::disconnected, this, | 600 | m_xwayland.destroyConnection = connect(m_xwayland.client, &KWaylandServer::ClientConnection::disconnected, this, | ||
601 | [] { | 601 | [] { | ||
602 | qFatal("Xwayland Connection died"); | 602 | qFatal("Xwayland Connection died"); | ||
603 | } | 603 | } | ||
604 | ); | 604 | ); | ||
605 | return socket.fd; | 605 | return socket.fd; | ||
606 | } | 606 | } | ||
607 | 607 | | |||
608 | void WaylandServer::destroyXWaylandConnection() | 608 | void WaylandServer::destroyXWaylandConnection() | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 707 | auto it = std::find_if(clients.begin(), clients.end(), | |||
710 | } | 710 | } | ||
711 | ); | 711 | ); | ||
712 | if (it == clients.end()) { | 712 | if (it == clients.end()) { | ||
713 | return nullptr; | 713 | return nullptr; | ||
714 | } | 714 | } | ||
715 | return *it; | 715 | return *it; | ||
716 | } | 716 | } | ||
717 | 717 | | |||
718 | static AbstractClient *findClientInList(const QList<AbstractClient *> &clients, KWayland::Server::SurfaceInterface *surface) | 718 | static AbstractClient *findClientInList(const QList<AbstractClient *> &clients, KWaylandServer::SurfaceInterface *surface) | ||
719 | { | 719 | { | ||
720 | auto it = std::find_if(clients.begin(), clients.end(), | 720 | auto it = std::find_if(clients.begin(), clients.end(), | ||
721 | [surface] (AbstractClient *c) { | 721 | [surface] (AbstractClient *c) { | ||
722 | return c->surface() == surface; | 722 | return c->surface() == surface; | ||
723 | } | 723 | } | ||
724 | ); | 724 | ); | ||
725 | if (it == clients.end()) { | 725 | if (it == clients.end()) { | ||
726 | return nullptr; | 726 | return nullptr; | ||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |