add RestartGamemode command

This allows gamemode to leave the context and then enter it again, which
re-applies all system optimizations. It is useful in cases where another
program (like TLP) may override gamemode's optimizations.

This is exposed to users by the -R or --restart flags to gamemoded.
This commit is contained in:
MithicSpirit
2025-02-15 13:14:34 -05:00
committed by afayaz-feral
parent af07e169d5
commit ce6fe122f3
6 changed files with 128 additions and 5 deletions

View File

@@ -379,6 +379,12 @@ extern int real_gamemode_query_status(void)
{
return gamemode_request("QueryStatus", 0);
}
//
// Wrapper to call RestartGamemode
extern int real_gamemode_request_restart(void)
{
return gamemode_request("RestartGamemode", 0);
}
// Wrapper to call RegisterGameByPID
extern int real_gamemode_request_start_for(pid_t pid)