Changeset View
Changeset View
Standalone View
Standalone View
main_wayland.cpp
Show All 19 Lines | |||||
20 | #include "main_wayland.h" | 20 | #include "main_wayland.h" | ||
21 | #include "composite.h" | 21 | #include "composite.h" | ||
22 | #include "virtualkeyboard.h" | 22 | #include "virtualkeyboard.h" | ||
23 | #include "workspace.h" | 23 | #include "workspace.h" | ||
24 | #include <config-kwin.h> | 24 | #include <config-kwin.h> | ||
25 | // kwin | 25 | // kwin | ||
26 | #include "platform.h" | 26 | #include "platform.h" | ||
27 | #include "effects.h" | 27 | #include "effects.h" | ||
28 | #include "screens.h" | ||||
28 | #include "tabletmodemanager.h" | 29 | #include "tabletmodemanager.h" | ||
29 | #include "wayland_server.h" | 30 | #include "wayland_server.h" | ||
30 | #include "xwl/xwayland.h" | 31 | #include "xwl/xwayland.h" | ||
31 | 32 | | |||
32 | // KWayland | 33 | // KWayland | ||
33 | #include <KWayland/Server/display.h> | 34 | #include <KWayland/Server/display.h> | ||
34 | #include <KWayland/Server/seat_interface.h> | 35 | #include <KWayland/Server/seat_interface.h> | ||
35 | // KDE | 36 | // KDE | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 119 | { | |||
140 | } | 141 | } | ||
141 | // kill Xwayland before terminating its connection | 142 | // kill Xwayland before terminating its connection | ||
142 | delete m_xwayland; | 143 | delete m_xwayland; | ||
143 | m_xwayland = nullptr; | 144 | m_xwayland = nullptr; | ||
144 | waylandServer()->terminateClientConnections(); | 145 | waylandServer()->terminateClientConnections(); | ||
145 | destroyCompositor(); | 146 | destroyCompositor(); | ||
146 | } | 147 | } | ||
147 | 148 | | |||
149 | void ApplicationWayland::setX11Scale(int scale) { | ||||
150 | // TODO: change this to actual release number | ||||
151 | if (!m_xwayland || m_xwayland->releaseNumber() < 12099000) { | ||||
152 | return; | ||||
153 | } | ||||
154 | m_x11Scale = scale; | ||||
155 | } | ||||
156 | | ||||
148 | void ApplicationWayland::performStartup() | 157 | void ApplicationWayland::performStartup() | ||
149 | { | 158 | { | ||
150 | if (m_startXWayland) { | 159 | if (m_startXWayland) { | ||
151 | setOperationMode(OperationModeXwayland); | 160 | setOperationMode(OperationModeXwayland); | ||
152 | } | 161 | } | ||
153 | // first load options - done internally by a different thread | 162 | // first load options - done internally by a different thread | ||
154 | createOptions(); | 163 | createOptions(); | ||
155 | waylandServer()->createInternalConnection(); | 164 | waylandServer()->createInternalConnection(); | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | |||||
275 | } | 284 | } | ||
276 | 285 | | |||
277 | static const QString s_waylandPlugin = QStringLiteral("KWinWaylandWaylandBackend"); | 286 | static const QString s_waylandPlugin = QStringLiteral("KWinWaylandWaylandBackend"); | ||
278 | static const QString s_x11Plugin = QStringLiteral("KWinWaylandX11Backend"); | 287 | static const QString s_x11Plugin = QStringLiteral("KWinWaylandX11Backend"); | ||
279 | static const QString s_fbdevPlugin = QStringLiteral("KWinWaylandFbdevBackend"); | 288 | static const QString s_fbdevPlugin = QStringLiteral("KWinWaylandFbdevBackend"); | ||
280 | #if HAVE_DRM | 289 | #if HAVE_DRM | ||
281 | static const QString s_drmPlugin = QStringLiteral("KWinWaylandDrmBackend"); | 290 | static const QString s_drmPlugin = QStringLiteral("KWinWaylandDrmBackend"); | ||
282 | #endif | 291 | #endif | ||
283 | #if HAVE_LIBHYBRIS | 292 | #if HAVE_LIBHYBRIS | ||
romangg: Pkgconfig wouldn't work on user installs, since it's something installed with dev packages. | |||||
284 | static const QString s_hwcomposerPlugin = QStringLiteral("KWinWaylandHwcomposerBackend"); | 293 | static const QString s_hwcomposerPlugin = QStringLiteral("KWinWaylandHwcomposerBackend"); | ||
285 | #endif | 294 | #endif | ||
286 | static const QString s_virtualPlugin = QStringLiteral("KWinWaylandVirtualBackend"); | 295 | static const QString s_virtualPlugin = QStringLiteral("KWinWaylandVirtualBackend"); | ||
287 | 296 | | |||
288 | static QString automaticBackendSelection() | 297 | static QString automaticBackendSelection() | ||
289 | { | 298 | { | ||
290 | if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) { | 299 | if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) { | ||
291 | return s_waylandPlugin; | 300 | return s_waylandPlugin; | ||
▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines |
Pkgconfig wouldn't work on user installs, since it's something installed with dev packages.
I'm thinking about adding a -version argument to XWayland, that just returns its version in the raw format the same way it is returned by xcb_get_setup(c)->release_number above (for example 12099000) and then quits.
Then before launching XWayland with all arguments compositors would need to launch XWayland -version first and see if an error is returned because the argument is not known or if not, what's the version number.
Of course one could also just directly try to launch XWayland with the option, but then one would need to redo all the process afterwards in case it fails.