Add GameMode support for Linux build (#796)

This commit is contained in:
Nicholas F 2023-05-11 01:19:44 -04:00 committed by GitHub
parent b74ae21953
commit 1bcdb35e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 467 additions and 1 deletions

View file

@ -61,6 +61,11 @@
#include "gui/helpers/wxWayland.h"
#endif
//GameMode support
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
#include "gamemode_client.h"
#endif
#include "Cafe/TitleList/TitleInfo.h"
#include "Cafe/TitleList/TitleList.h"
#include "wxHelper.h"
@ -581,6 +586,23 @@ bool MainWindow::FileLoad(std::wstring fileName, wxLaunchGameEvent::INITIATED_BY
if (ActiveSettings::FullscreenEnabled())
SetFullScreen(true);
//GameMode support
#if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE)
if(GetConfig().feral_gamemode)
{
// attempt to start gamemode
if(gamemode_request_start() < 0)
{
// GameMode failed to start
cemuLog_log(LogType::Force, "Could not start GameMode");
}
else
{
cemuLog_log(LogType::Force, "GameMode has been started.");
}
}
#endif
CreateCanvas();
CafeSystem::LaunchForegroundTitle();
RecreateMenu();