Add initial screensaver inhibiting code

This commit is contained in:
Marc Di Luzio
2019-01-27 13:19:27 +00:00
parent 6544bfb99d
commit 42dd7e6ea8
3 changed files with 77 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "gamemode.h"
#include "daemon_config.h"
#include "dbus_messaging.h"
#include "governors-query.h"
#include "governors.h"
#include "helpers.h"
@@ -202,6 +203,9 @@ static void game_mode_context_enter(GameModeContext *self)
memset(self->initial_cpu_mode, 0, sizeof(self->initial_cpu_mode));
}
}
/* Inhibit the screensaver */
game_mode_inhibit_screensaver(true);
}
/**
@@ -215,6 +219,9 @@ static void game_mode_context_leave(GameModeContext *self)
LOG_MSG("Leaving Game Mode...\n");
sd_notifyf(0, "STATUS=%sGameMode is currently deactivated.%s\n", "\x1B[1;36m", "\x1B[0m");
/* UnInhibit the screensaver */
game_mode_inhibit_screensaver(false);
/* Reset the governer state back to initial */
if (self->initial_cpu_mode[0] != '\0') {
/* Choose the governor to reset to, using the config to override */