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

@@ -155,6 +155,16 @@ int game_mode_context_unregister(GameModeContext *self, pid_t pid, pid_t request
*/
int game_mode_context_query_status(GameModeContext *self, pid_t pid, pid_t requester);
/**
* Restart gamemode if it is running
*
* @param pid Process ID for the remote client
* @returns 0 if gamemode was restarted
* 1 if gamemode was already deactivated
* -2 if this request was rejected
*/
int game_mode_context_restart(GameModeContext *self, pid_t pid, pid_t requester);
/**
* Query the config of a gamemode context
*