mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:05:59 +01:00
parent
76c6e09e39
commit
f6b340cc19
2 changed files with 11 additions and 2 deletions
|
@ -6,7 +6,15 @@ bool Init::isSudo() {
|
||||||
|
|
||||||
void Init::gainRealTime() {
|
void Init::gainRealTime() {
|
||||||
const int minPrio = sched_get_priority_min(SCHED_RR);
|
const int minPrio = sched_get_priority_min(SCHED_RR);
|
||||||
const struct sched_param param = {.sched_priority = minPrio};
|
int old_policy;
|
||||||
|
struct sched_param param;
|
||||||
|
|
||||||
|
if (pthread_getschedparam(pthread_self(), &old_policy, ¶m)) {
|
||||||
|
Debug::log(WARN, "Failed to get old pthread scheduling priority");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
param.sched_priority = minPrio;
|
||||||
|
|
||||||
if (pthread_setschedparam(pthread_self(), SCHED_RR, ¶m)) {
|
if (pthread_setschedparam(pthread_self(), SCHED_RR, ¶m)) {
|
||||||
Debug::log(WARN, "Failed to change process scheduling strategy");
|
Debug::log(WARN, "Failed to change process scheduling strategy");
|
||||||
|
|
|
@ -89,7 +89,6 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Welcome to Hyprland!\n";
|
std::cout << "Welcome to Hyprland!\n";
|
||||||
Init::gainRealTime();
|
|
||||||
|
|
||||||
// let's init the compositor.
|
// let's init the compositor.
|
||||||
// it initializes basic Wayland stuff in the constructor.
|
// it initializes basic Wayland stuff in the constructor.
|
||||||
|
@ -98,6 +97,8 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
g_pCompositor->initServer();
|
g_pCompositor->initServer();
|
||||||
|
|
||||||
|
Init::gainRealTime();
|
||||||
|
|
||||||
Debug::log(LOG, "Hyprland init finished.");
|
Debug::log(LOG, "Hyprland init finished.");
|
||||||
|
|
||||||
// If all's good to go, start.
|
// If all's good to go, start.
|
||||||
|
|
Loading…
Reference in a new issue