Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show All 20 Lines | |||||
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 "waylandxdgshellintegration.h" | 26 | #include "waylandxdgshellintegration.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | #include "xdgshellclient.h" | 28 | #include "xdgshellclient.h" | ||
29 | #include "service_utils.h" | ||||
29 | 30 | | |||
30 | // Client | 31 | // Client | ||
31 | #include <KWayland/Client/connection_thread.h> | 32 | #include <KWayland/Client/connection_thread.h> | ||
32 | #include <KWayland/Client/event_queue.h> | 33 | #include <KWayland/Client/event_queue.h> | ||
33 | #include <KWayland/Client/registry.h> | 34 | #include <KWayland/Client/registry.h> | ||
34 | #include <KWayland/Client/compositor.h> | 35 | #include <KWayland/Client/compositor.h> | ||
35 | #include <KWayland/Client/seat.h> | 36 | #include <KWayland/Client/seat.h> | ||
36 | #include <KWayland/Client/datadevicemanager.h> | 37 | #include <KWayland/Client/datadevicemanager.h> | ||
Show All 26 Lines | |||||
63 | #include <KWaylandServer/xdgdecoration_v1_interface.h> | 64 | #include <KWaylandServer/xdgdecoration_v1_interface.h> | ||
64 | #include <KWaylandServer/xdgshell_interface.h> | 65 | #include <KWaylandServer/xdgshell_interface.h> | ||
65 | #include <KWaylandServer/xdgforeign_interface.h> | 66 | #include <KWaylandServer/xdgforeign_interface.h> | ||
66 | #include <KWaylandServer/xdgoutput_interface.h> | 67 | #include <KWaylandServer/xdgoutput_interface.h> | ||
67 | #include <KWaylandServer/keystate_interface.h> | 68 | #include <KWaylandServer/keystate_interface.h> | ||
68 | #include <KWaylandServer/filtered_display.h> | 69 | #include <KWaylandServer/filtered_display.h> | ||
69 | #include <KWaylandServer/keyboard_shortcuts_inhibit_v1_interface.h> | 70 | #include <KWaylandServer/keyboard_shortcuts_inhibit_v1_interface.h> | ||
70 | 71 | | |||
71 | // KF | | |||
72 | #include <KServiceTypeTrader> | | |||
73 | | ||||
74 | // Qt | 72 | // Qt | ||
75 | #include <QCryptographicHash> | 73 | #include <QCryptographicHash> | ||
76 | #include <QDir> | 74 | #include <QDir> | ||
77 | #include <QFileInfo> | 75 | #include <QFileInfo> | ||
78 | #include <QThread> | 76 | #include <QThread> | ||
79 | #include <QWindow> | 77 | #include <QWindow> | ||
80 | 78 | | |||
81 | // system | 79 | // system | ||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Line(s) | 231 | bool isTrustedOrigin(KWaylandServer::ClientConnection *client) const { | |||
238 | if (!trusted) { | 236 | if (!trusted) { | ||
239 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | 237 | qCWarning(KWIN_CORE) << "Could not trust" << client->executablePath() << "sha" << localSha << fullPathSha; | ||
240 | } | 238 | } | ||
241 | 239 | | |||
242 | return trusted; | 240 | return trusted; | ||
243 | } | 241 | } | ||
244 | 242 | | |||
245 | QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { | 243 | QStringList fetchRequestedInterfaces(KWaylandServer::ClientConnection *client) const { | ||
246 | const auto serviceQuery = QStringLiteral("exist Exec and exist [X-KDE-Wayland-Interfaces] and '%1' =~ Exec").arg(client->executablePath()); | 244 | return KWin::fetchRequestedInterfaces(client->executablePath()); | ||
247 | const auto servicesFound = KServiceTypeTrader::self()->query(QStringLiteral("Application"), serviceQuery); | | |||
248 | | ||||
249 | if (servicesFound.isEmpty()) { | | |||
250 | qCDebug(KWIN_CORE) << "Could not find the desktop file for" << client->executablePath(); | | |||
251 | return {}; | | |||
252 | } | | |||
253 | | ||||
254 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | | |||
255 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | | |||
256 | return interfaces; | | |||
257 | } | 245 | } | ||
258 | 246 | | |||
259 | const QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | 247 | const QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | ||
260 | QSet<QString> m_reported; | 248 | QSet<QString> m_reported; | ||
261 | 249 | | |||
262 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | 250 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | ||
263 | if (client->processId() == getpid()) { | 251 | if (client->processId() == getpid()) { | ||
264 | return true; | 252 | return true; | ||
▲ Show 20 Lines • Show All 612 Lines • Show Last 20 Lines |