Commit graph

13 commits

Author SHA1 Message Date
David Edmundson
ff99100ec5 Fix build 2021-08-17 13:17:27 +01:00
David Edmundson
f541d851ed [kwin_wrapper] Transfer ownership of Xwayland socket creation and Xauthority to the wrapper
This way if kwin_wayland crashes we don't need to ensure that new
environment variables need to get synced across the new env.

This fixes an issue where spawning an xwayland application from a
wayland window that survives a crash would fail.

By moving the logic here we no longer need to wait for kwin_wayland to
start before starting plasmashell or even ksmserver as all environment
variables are set. As long as the wrapper is ready we can continue
starting and clients will just block on connect.

That should still allow for both a lot of optimisations both for speed
and cleaning up the startplasma-wayland scripts.

This will be addressed in follow up patches.

Use of kwin_wayland directly with xwayland is still supported for
testing.
2021-08-17 09:41:57 +01:00
Vlad Zahorodnii
1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00
Vlad Zahorodnii
72cc1daf22 wayland: Introduce an environment variable to disable Xauthority
This is primarily intended for debugging purposes.
2021-03-29 11:37:28 +00:00
Vlad Zahorodnii
6a26540065 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.
2021-03-02 13:29:22 +00:00
Vlad Zahorodnii
22d386cdd8 xwayland: Improve handling of Xwayland restarts
At the moment, the display name might change between Xwayland restarts.
It is a problem because the session process (plasma) may have an
outdated value of the DISPLAY environment variable after a restart.

With this change, it is guaranteed that the DISPLAY and the Xauthority
file stay the same until the server is stopped explicitly.
2021-02-15 18:09:46 +00:00
Vlad Zahorodnii
a2c7c66d8a xwayland: Emit Xwayland::started() after WM_S0 is claimed
Xwayland starts listening to -listenfd file descriptors after the WM_S0
selection is claimed. At the moment, it is claimed asynchronously by
kwin. First, we create a dummy window and change one of its properties
to get the timestamp. After the timestamp has been received, we actually
call xcb_set_selection_owner().
2021-02-11 15:10:01 +00:00
Vlad Zahorodnii
9f0f452702 xwayland: Manually create sockets
This provides kwin greater control over how X11 sockets are created for
Xwayland. For example, it can be used to ensure that the DISPLAY remains
the same across Xwayland server restarts or launching Xwayland on
demand.

Even though -listen <fd> option is deprecated, we still pass it because
older versions of Xwayland may not have the -listenfd option.
2021-02-11 15:10:01 +00:00
Fabian Vogt
7c325b7436 xwayland: Also write a FamilyWild entry to the Xauthority file
This is needed to deal with hostname changes during lifetime of a session.
2021-02-10 18:19:17 +00:00
Fabian Vogt
06d2a31bd3 xwayland: Rename updateXauthorityFile and add error handling
This renames updateXauthorityFile to writeXauthorityEntries as it doesn't
actually update (i.e. change) anything, it just writes new ones.

Error handling is introduced, to avoid that it continues silently without
entries, which would cause all connections to fail.
2021-02-10 18:19:16 +00:00
Fabian Vogt
d51703e335 xwayland: Simplify writeXauthorityEntry
Extract writing of what libXau calls "counted strings".
2021-02-10 18:19:16 +00:00
Fabian Vogt
357713fa78 xwayland: Simplify m_authorityFile
Use a shorter file name (which is already part of apparmor profiles) and avoid
using a pointer.
2021-02-10 18:19:16 +00:00
Vlad Zahorodnii
93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
2021-02-10 15:31:43 +00:00
Renamed from xwl/xwayland.cpp (Browse further)