mirror of
https://github.com/brl/mutter.git
synced 2025-02-18 14:14:10 +00:00
core: Set SCHED_RR by default on Wayland sessions
This still may fail if the executable is missing the right capability. This can no longer depend on a setting as we want this to happen before capabilities are dropped (and before other threads are spawned). The necessary bits (eg. "setcap CAP_SYS_NICE=+ep `which gnome-shell`") are still left up to users/distributors. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
This commit is contained in:
parent
9d61e6e56f
commit
b7a662bfdd
@ -341,7 +341,6 @@ static void
|
||||
meta_backend_native_post_init (MetaBackend *backend)
|
||||
{
|
||||
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
|
||||
META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
|
||||
|
||||
@ -349,20 +348,6 @@ meta_backend_native_post_init (MetaBackend *backend)
|
||||
NULL, NULL);
|
||||
meta_device_manager_native_set_relative_motion_filter (manager, relative_motion_filter,
|
||||
meta_backend_get_monitor_manager (backend));
|
||||
|
||||
if (meta_settings_is_experimental_feature_enabled (settings,
|
||||
META_EXPERIMENTAL_FEATURE_RT_SCHEDULER))
|
||||
{
|
||||
int retval;
|
||||
struct sched_param sp = {
|
||||
.sched_priority = sched_get_priority_min (SCHED_RR)
|
||||
};
|
||||
|
||||
retval = sched_setscheduler (0, SCHED_RR | SCHED_RESET_ON_FORK, &sp);
|
||||
|
||||
if (retval != 0)
|
||||
g_warning ("Failed to set RT scheduler: %m");
|
||||
}
|
||||
}
|
||||
|
||||
static MetaMonitorManager *
|
||||
|
@ -522,6 +522,22 @@ meta_override_compositor_configuration (MetaCompositorType compositor_type,
|
||||
_backend_gtype_override = backend_gtype;
|
||||
}
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
static void
|
||||
meta_set_scheduler (void)
|
||||
{
|
||||
int retval;
|
||||
struct sched_param sp = {
|
||||
.sched_priority = sched_get_priority_min (SCHED_RR)
|
||||
};
|
||||
|
||||
retval = sched_setscheduler (0, SCHED_RR | SCHED_RESET_ON_FORK, &sp);
|
||||
|
||||
if (retval != 0)
|
||||
g_warning ("Failed to set RT scheduler: %m");
|
||||
}
|
||||
#endif /* HAVE_NATIVE_BACKEND */
|
||||
|
||||
/**
|
||||
* meta_init: (skip)
|
||||
*
|
||||
@ -573,6 +589,11 @@ meta_init (void)
|
||||
meta_set_is_wayland_compositor (TRUE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
if (backend_gtype == META_TYPE_BACKEND_NATIVE)
|
||||
meta_set_scheduler ();
|
||||
#endif
|
||||
|
||||
g_unix_signal_add (SIGTERM, on_sigterm, NULL);
|
||||
|
||||
if (g_get_home_dir ())
|
||||
|
Loading…
x
Reference in New Issue
Block a user