Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | #include <KWayland/Server/outputmanagement_interface.h> | 61 | #include <KWayland/Server/outputmanagement_interface.h> | ||
62 | #include <KWayland/Server/outputconfiguration_interface.h> | 62 | #include <KWayland/Server/outputconfiguration_interface.h> | ||
63 | #include <KWayland/Server/xdgdecoration_interface.h> | 63 | #include <KWayland/Server/xdgdecoration_interface.h> | ||
64 | #include <KWayland/Server/xdgshell_interface.h> | 64 | #include <KWayland/Server/xdgshell_interface.h> | ||
65 | #include <KWayland/Server/xdgforeign_interface.h> | 65 | #include <KWayland/Server/xdgforeign_interface.h> | ||
66 | #include <KWayland/Server/xdgoutput_interface.h> | 66 | #include <KWayland/Server/xdgoutput_interface.h> | ||
67 | #include <KWayland/Server/keystate_interface.h> | 67 | #include <KWayland/Server/keystate_interface.h> | ||
68 | #include <KWayland/Server/filtered_display.h> | 68 | #include <KWayland/Server/filtered_display.h> | ||
69 | #include <KWayland/Server/inputmethod_interface.h> | ||||
69 | 70 | | |||
70 | // KF | 71 | // KF | ||
71 | #include <KServiceTypeTrader> | 72 | #include <KServiceTypeTrader> | ||
72 | 73 | | |||
73 | // Qt | 74 | // Qt | ||
74 | #include <QCryptographicHash> | 75 | #include <QCryptographicHash> | ||
75 | #include <QDir> | 76 | #include <QDir> | ||
76 | #include <QFileInfo> | 77 | #include <QFileInfo> | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
148 | void WaylandServer::createSurface(T *surface) | 149 | void WaylandServer::createSurface(T *surface) | ||
149 | { | 150 | { | ||
150 | if (!Workspace::self()) { | 151 | if (!Workspace::self()) { | ||
151 | // it's possible that a Surface gets created before Workspace is created | 152 | // it's possible that a Surface gets created before Workspace is created | ||
152 | return; | 153 | return; | ||
153 | } | 154 | } | ||
154 | if (surface->client() == m_xwayland.client) { | 155 | if (surface->client() == m_xwayland.client) { | ||
155 | // skip Xwayland clients, those are created using standard X11 way | 156 | // skip Xwayland clients, those are created using standard X11 way | ||
156 | return; | 157 | return; | ||
157 | } | 158 | } | ||
158 | if (surface->client() == m_screenLockerClientConnection) { | 159 | if (surface->client() == m_screenLockerClientConnection) { | ||
159 | ScreenLocker::KSldApp::self()->lockScreenShown(); | 160 | ScreenLocker::KSldApp::self()->lockScreenShown(); | ||
zzag: Leave it in `createSurface()`. You can't use xdg-foreign with non xdg_toplevel equivalent… | |||||
160 | } | 161 | } | ||
161 | XdgShellClient *client = new XdgShellClient(surface); | 162 | XdgShellClient *client = new XdgShellClient(surface); | ||
162 | if (ServerSideDecorationInterface *deco = ServerSideDecorationInterface::get(surface->surface())) { | 163 | if (ServerSideDecorationInterface *deco = ServerSideDecorationInterface::get(surface->surface())) { | ||
163 | client->installServerSideDecoration(deco); | 164 | client->installServerSideDecoration(deco); | ||
164 | } | 165 | } | ||
165 | auto it = std::find_if(m_plasmaShellSurfaces.begin(), m_plasmaShellSurfaces.end(), | 166 | auto it = std::find_if(m_plasmaShellSurfaces.begin(), m_plasmaShellSurfaces.end(), | ||
166 | [client] (PlasmaShellSurfaceInterface *surface) { | 167 | [client] (PlasmaShellSurfaceInterface *surface) { | ||
167 | return client->surface() == surface->surface(); | 168 | return client->surface() == surface->surface(); | ||
Show All 17 Lines | |||||
185 | } | 186 | } | ||
186 | 187 | | |||
187 | //not directly connected as the connection is tied to client instead of this | 188 | //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) { | 189 | connect(m_XdgForeign, &KWayland::Server::XdgForeignInterface::transientChanged, client, [this](KWayland::Server::SurfaceInterface *child) { | ||
189 | emit foreignTransientChanged(child); | 190 | emit foreignTransientChanged(child); | ||
190 | }); | 191 | }); | ||
191 | } | 192 | } | ||
192 | 193 | | |||
194 | AbstractClient *WaylandServer::createInputPanelSurface(KWayland::Server::InputPanelSurfaceInterface *surface) | ||||
195 | { | ||||
196 | XdgShellClient *client = new XdgShellClient(surface); | ||||
197 | m_clients << client; | ||||
198 | if (client->readyForPainting()) { | ||||
199 | emit shellClientAdded(client); | ||||
200 | } else { | ||||
201 | connect(client, &XdgShellClient::windowShown, this, &WaylandServer::shellClientShown); | ||||
202 | } | ||||
203 | | ||||
204 | //not directly connected as the connection is tied to client instead of this | ||||
205 | connect(m_XdgForeign, &KWayland::Server::XdgForeignInterface::transientChanged, client, [this](KWayland::Server::SurfaceInterface *child) { | ||||
206 | emit foreignTransientChanged(child); | ||||
207 | }); | ||||
208 | return client; | ||||
209 | } | ||||
210 | | ||||
193 | class KWinDisplay : public KWayland::Server::FilteredDisplay | 211 | class KWinDisplay : public KWayland::Server::FilteredDisplay | ||
194 | { | 212 | { | ||
195 | public: | 213 | public: | ||
196 | KWinDisplay(QObject *parent) | 214 | KWinDisplay(QObject *parent) | ||
197 | : KWayland::Server::FilteredDisplay(parent) | 215 | : KWayland::Server::FilteredDisplay(parent) | ||
198 | {} | 216 | {} | ||
199 | 217 | | |||
200 | static QByteArray sha256(const QString &fileName) | 218 | static QByteArray sha256(const QString &fileName) | ||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 301 | { | |||
446 | m_display->createSubCompositor(m_display)->create(); | 464 | m_display->createSubCompositor(m_display)->create(); | ||
447 | 465 | | |||
448 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | 466 | m_XdgForeign = m_display->createXdgForeignInterface(m_display); | ||
449 | m_XdgForeign->create(); | 467 | m_XdgForeign->create(); | ||
450 | 468 | | |||
451 | m_keyState = m_display->createKeyStateInterface(m_display); | 469 | m_keyState = m_display->createKeyStateInterface(m_display); | ||
452 | m_keyState->create(); | 470 | m_keyState->create(); | ||
453 | 471 | | |||
472 | m_inputMethod = m_display->createInputMethodInterface(m_display); | ||||
473 | m_inputPanel = m_display->createInputPanelInterface(m_display); | ||||
474 | | ||||
454 | return true; | 475 | return true; | ||
455 | } | 476 | } | ||
456 | 477 | | |||
457 | KWayland::Server::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() | 478 | KWayland::Server::LinuxDmabufUnstableV1Interface *WaylandServer::linuxDmabuf() | ||
458 | { | 479 | { | ||
459 | if (!m_linuxDmabuf) { | 480 | if (!m_linuxDmabuf) { | ||
460 | m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); | 481 | m_linuxDmabuf = m_display->createLinuxDmabufInterface(m_display); | ||
461 | m_linuxDmabuf->create(); | 482 | m_linuxDmabuf->create(); | ||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |
Leave it in createSurface(). You can't use xdg-foreign with non xdg_toplevel equivalent surfaces.