This tries to connect to DBUS to request RTTimeUSecMax from RTKit and
than changes the scheduling policy of sway to SCHED_RR. I tested the
impact using hackbench, with this patch I don't see any cursor
stuttering while running the following hackbench command:
$ hackbench -f 100 -l 100000 -s 100000
This also fixes the "your compositor is too slow"-warnings from
libinput.
The rtkit feature is currently auto, so if one of the SD-Bus libraries
is installed we will select it. However we will fail graciously with
only a debug note if we can't reach RTKit and won't touch RLIMIT_RTTIME
in this case. Users who don't want to have DBUS within sway itself can
disable the feature.
Let's set the version in the meson file instead of declaring it outside.
In case git is installed we use the git hash as version. Instead it
isn't (like on a clean build system), let's use the version defined in
the project.
It's better to use DT_RPATH dynamic section of the elf binary to store
the paths of libraries to load instead of overwriting LD_LIBRARY_PATH
for the whole environment, causing surprises. This solution is much more
transparent and perfectly suitable for running contained installations
of wayland/wlroots/sway.
The code unsetting the LD_LIBRARY_PATH/LD_PRELOAD was also deleted as
it's a placebo security at best - we should trust the execution path
that leads us to running sway, and it's way too late to care about those
variables since we already started executing our compositor, thus we
would be compromised anyway.