sway: request SCHED_RR via RTKit

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.
This commit is contained in:
Rouven Czerwinski 2022-05-13 20:30:19 +02:00
parent ffc603d451
commit 4fa003dff1
6 changed files with 89 additions and 0 deletions

View file

@ -173,4 +173,6 @@ void handle_pointer_constraint(struct wl_listener *listener, void *data);
void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
void *data);
void gain_realtime(void);
#endif