mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-08-06 13:18:31 +02:00
Add initial screensaver inhibiting code
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user