wayland: Query pkg-config if Xwayland supports listenfd
-listen <fd> option is deprecated in favor of the -listenfd option. This change makes kwin query whether Xwayland supports the -listenfd option at build time. If the pkg-config file is missing, we'll use the old listen option.icc-effect-5.26.4
parent
b409f523f0
commit
6a26540065
|
@ -294,6 +294,7 @@ set_package_properties(Xwayland PROPERTIES
|
|||
TYPE RUNTIME
|
||||
PURPOSE "Needed for running kwin_wayland"
|
||||
)
|
||||
set(HAVE_XWAYLAND_LISTENFD ${Xwayland_HAVE_LISTENFD})
|
||||
|
||||
find_package(Libcap)
|
||||
set_package_properties(Libcap PROPERTIES
|
||||
|
|
|
@ -1,13 +1,39 @@
|
|||
#.rst:
|
||||
# FindXwayland
|
||||
# -------
|
||||
#
|
||||
# Try to find Xwayland on a Unix system.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``Xwayland_FOUND``
|
||||
# True if (the requested version of) Xwayland is available
|
||||
# ``Xwayland_VERSION``
|
||||
# The version of Xwayland
|
||||
# ``Xwayland_HAVE_LISTENFD``
|
||||
# True if (the requested version of) Xwayland has -listenfd option
|
||||
|
||||
#=============================================================================
|
||||
# SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#=============================================================================
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_xwayland QUIET xwayland)
|
||||
|
||||
set(Xwayland_VERSION ${PKG_xwayland_VERSION})
|
||||
pkg_get_variable(Xwayland_HAVE_LISTENFD xwayland have_listenfd)
|
||||
|
||||
find_program(Xwayland_EXECUTABLE NAMES Xwayland)
|
||||
find_package_handle_standard_args(Xwayland
|
||||
FOUND_VAR
|
||||
Xwayland_FOUND
|
||||
REQUIRED_VARS
|
||||
Xwayland_EXECUTABLE
|
||||
FOUND_VAR Xwayland_FOUND
|
||||
REQUIRED_VARS Xwayland_EXECUTABLE
|
||||
VERSION_VAR Xwayland_VERSION
|
||||
)
|
||||
mark_as_advanced(
|
||||
Xwayland_EXECUTABLE
|
||||
Xwayland_HAVE_LISTENFD
|
||||
Xwayland_VERSION
|
||||
)
|
||||
mark_as_advanced(Xwayland_EXECUTABLE)
|
||||
|
|
|
@ -48,3 +48,5 @@
|
|||
#endif
|
||||
|
||||
#cmakedefine PipeWire_FOUND 1
|
||||
|
||||
#cmakedefine HAVE_XWAYLAND_LISTENFD
|
||||
|
|
|
@ -215,6 +215,22 @@ bool Xwayland::startInternal()
|
|||
|
||||
m_xcbConnectionFd = sx[0];
|
||||
|
||||
QStringList arguments {
|
||||
m_socket->name(),
|
||||
QStringLiteral("-displayfd"), QString::number(pipeFds[1]),
|
||||
QStringLiteral("-rootless"),
|
||||
QStringLiteral("-wm"), QString::number(fd),
|
||||
QStringLiteral("-auth"), m_authorityFile.fileName(),
|
||||
};
|
||||
|
||||
#if defined(HAVE_XWAYLAND_LISTENFD)
|
||||
arguments << QStringLiteral("-listenfd") << QString::number(abstractSocket)
|
||||
<< QStringLiteral("-listenfd") << QString::number(unixSocket);
|
||||
#else
|
||||
arguments << QStringLiteral("-listen") << QString::number(abstractSocket)
|
||||
<< QStringLiteral("-listen") << QString::number(unixSocket);
|
||||
#endif
|
||||
|
||||
m_xwaylandProcess = new Process(this);
|
||||
m_xwaylandProcess->setProcessChannelMode(QProcess::ForwardedErrorChannel);
|
||||
m_xwaylandProcess->setProgram(QStringLiteral("Xwayland"));
|
||||
|
@ -225,13 +241,7 @@ bool Xwayland::startInternal()
|
|||
env.insert("WAYLAND_DEBUG", QByteArrayLiteral("1"));
|
||||
}
|
||||
m_xwaylandProcess->setProcessEnvironment(env);
|
||||
m_xwaylandProcess->setArguments({m_socket->name(),
|
||||
QStringLiteral("-displayfd"), QString::number(pipeFds[1]),
|
||||
QStringLiteral("-rootless"),
|
||||
QStringLiteral("-wm"), QString::number(fd),
|
||||
QStringLiteral("-auth"), m_authorityFile.fileName(),
|
||||
QStringLiteral("-listen"), QString::number(abstractSocket),
|
||||
QStringLiteral("-listen"), QString::number(unixSocket)});
|
||||
m_xwaylandProcess->setArguments(arguments);
|
||||
connect(m_xwaylandProcess, &QProcess::errorOccurred, this, &Xwayland::handleXwaylandError);
|
||||
connect(m_xwaylandProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
this, &Xwayland::handleXwaylandFinished);
|
||||
|
|
Loading…
Reference in New Issue