Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show All 19 Lines | |||||
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 "xdgshellclient.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | #include "service_utils.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 25 Lines | |||||
61 | #include <KWaylandServer/outputconfiguration_interface.h> | 62 | #include <KWaylandServer/outputconfiguration_interface.h> | ||
62 | #include <KWaylandServer/xdgdecoration_interface.h> | 63 | #include <KWaylandServer/xdgdecoration_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 | #include <KServiceTypeTrader> | | |||
71 | | ||||
72 | // Qt | 70 | // Qt | ||
73 | #include <QCryptographicHash> | 71 | #include <QCryptographicHash> | ||
74 | #include <QDir> | 72 | #include <QDir> | ||
75 | #include <QFileInfo> | 73 | #include <QFileInfo> | ||
76 | #include <QThread> | 74 | #include <QThread> | ||
77 | #include <QWindow> | 75 | #include <QWindow> | ||
78 | 76 | | |||
79 | // system | 77 | // system | ||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 209 | bool isTrustedOrigin(KWaylandServer::ClientConnection *client) const { | |||
216 | if (!trusted) { | 214 | if (!trusted) { | ||
217 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | 215 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | ||
218 | } | 216 | } | ||
219 | 217 | | |||
220 | return trusted; | 218 | return trusted; | ||
221 | } | 219 | } | ||
222 | 220 | | |||
223 | QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { | 221 | QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { | ||
224 | const auto serviceQuery = QStringLiteral("exist Exec and exist [X-KDE-Wayland-Interfaces] and '%1' =~ Exec").arg(client->executablePath()); | 222 | return KWin::fetchRequestedWaylandInterfaces(client->executablePath()); | ||
225 | const auto servicesFound = KServiceTypeTrader::self()->query(QStringLiteral("Application"), serviceQuery); | | |||
226 | | ||||
227 | if (servicesFound.isEmpty()) { | | |||
228 | qCDebug(KWIN_CORE) << "Could not find the desktop file for" << client->executablePath(); | | |||
229 | return {}; | | |||
230 | } | | |||
231 | | ||||
232 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | | |||
233 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | | |||
234 | return interfaces; | | |||
235 | } | 223 | } | ||
236 | 224 | | |||
237 | QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | 225 | QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | ||
238 | 226 | | |||
239 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | 227 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | ||
240 | if (client->processId() == getpid()) { | 228 | if (client->processId() == getpid()) { | ||
241 | return true; | 229 | return true; | ||
242 | } | 230 | } | ||
▲ Show 20 Lines • Show All 593 Lines • Show Last 20 Lines |