@ -20,6 +20,8 @@
# ifdef __unix__
# include <csignal>
# include <sys/socket.h>
# endif
# ifdef __linux__
# include "common/linux/gamemode.h"
# endif
@ -37,8 +39,8 @@
# include "configuration/configure_input.h"
# include "configuration/configure_per_game.h"
# include "configuration/configure_tas.h"
# include "core/file_sys/romfs_factory.h"
# include "core/core_timing.h"
# include "core/file_sys/romfs_factory.h"
# include "core/file_sys/vfs/vfs.h"
# include "core/file_sys/vfs/vfs_real.h"
# include "core/frontend/applets/cabinet.h"
@ -313,8 +315,7 @@ bool GMainWindow::CheckDarkMode() {
GMainWindow : : GMainWindow ( bool has_broken_vulkan )
: ui { std : : make_unique < Ui : : MainWindow > ( ) } , system { std : : make_unique < Core : : System > ( ) } ,
input_subsystem { std : : make_shared < InputCommon : : InputSubsystem > ( ) } ,
user_data_migrator { this } ,
input_subsystem { std : : make_shared < InputCommon : : InputSubsystem > ( ) } , user_data_migrator { this } ,
vfs { std : : make_shared < FileSys : : RealVfsFilesystem > ( ) } ,
provider { std : : make_unique < FileSys : : ManualContentProvider > ( ) } {
Common : : FS : : CreateEdenPaths ( ) ;
@ -322,7 +323,8 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
if ( user_data_migrator . migrated ) {
// Sort-of hack whereby we only move the old dir if it's a subfolder of the user dir
# define MIGRATE_DIR(type) std::string type##path = Common::FS::GetEdenPathString(Common::FS::EdenPath::type##Dir); \
# define MIGRATE_DIR(type) \
std : : string type # # path = Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : type # # Dir ) ; \
if ( type # # path . starts_with ( user_data_migrator . selected_emu . get_user_dir ( ) ) ) { \
boost : : replace_all ( type # # path , user_data_migrator . selected_emu . lower_name ( ) , " eden " ) ; \
Common : : FS : : SetEdenPath ( Common : : FS : : EdenPath : : type # # Dir , type # # path ) ; \
@ -338,8 +340,12 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
# ifdef __unix__
SetupSigInterrupts ( ) ;
# endif
# ifdef __linux__
SetGamemodeEnabled ( Settings : : values . enable_gamemode . GetValue ( ) ) ;
# endif
UISettings : : RestoreWindowState ( config ) ;
system - > Initialize ( ) ;
@ -436,8 +442,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
# ifdef ENABLE_QT_UPDATE_CHECKER
if ( UISettings : : values . check_for_updates ) {
update_future = QtConcurrent : : run ( [ ] ( ) - > QString {
const bool is_prerelease =
( ( strstr ( Common : : g_build_version , " pre-alpha " ) ! = NULL ) | |
const bool is_prerelease = ( ( strstr ( Common : : g_build_version , " pre-alpha " ) ! = NULL ) | |
( strstr ( Common : : g_build_version , " alpha " ) ! = NULL ) | |
( strstr ( Common : : g_build_version , " beta " ) ! = NULL ) | |
( strstr ( Common : : g_build_version , " rc " ) ! = NULL ) ) ;
@ -1667,7 +1672,8 @@ void GMainWindow::ConnectMenuEvents() {
connect_menu ( ui - > action_Load_Home_Menu , & GMainWindow : : OnHomeMenu ) ;
connect_menu ( ui - > action_Open_Setup , & GMainWindow : : OnInitialSetup ) ;
connect_menu ( ui - > action_Desktop , & GMainWindow : : OnCreateHomeMenuDesktopShortcut ) ;
connect_menu ( ui - > action_Application_Menu , & GMainWindow : : OnCreateHomeMenuApplicationMenuShortcut ) ;
connect_menu ( ui - > action_Application_Menu ,
& GMainWindow : : OnCreateHomeMenuApplicationMenuShortcut ) ;
connect_menu ( ui - > action_Capture_Screenshot , & GMainWindow : : OnCaptureScreenshot ) ;
// TAS
@ -1872,7 +1878,6 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
system - > GetUserChannel ( ) . clear ( ) ;
}
system - > SetFrontendAppletSet ( {
std : : make_unique < QtAmiiboSettings > ( * this ) , // Amiibo Settings
( UISettings : : values . controller_applet_disabled . GetValue ( ) = = true )
@ -1894,12 +1899,14 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
QSettings settings ;
QStringList currentIgnored = settings . value ( " ignoredBadUpdates " , { } ) . toStringList ( ) ;
if ( std : : find ( bad_update_games . begin ( ) , bad_update_games . end ( ) , params . program_id ) ! = bad_update_games . end ( )
& & ! currentIgnored . contains ( QString : : number ( params . program_id ) ) ) {
if ( std : : find ( bad_update_games . begin ( ) , bad_update_games . end ( ) , params . program_id ) ! =
bad_update_games . end ( ) & &
! currentIgnored . contains ( QString : : number ( params . program_id ) ) ) {
QMessageBox * msg = new QMessageBox ( this ) ;
msg - > setWindowTitle ( tr ( " Game Updates Warning " ) ) ;
msg - > setIcon ( QMessageBox : : Warning ) ;
msg - > setText ( tr ( " The game you are trying to launch is known to have performance or booting "
msg - > setText (
tr ( " The game you are trying to launch is known to have performance or booting "
" issues when updates are applied. Please try increasing the memory layout to "
" 6GB or 8GB if any issues occur.<br><br>Press \" OK \" to continue launching, or "
" \" Cancel \" to cancel the launch. " ) ) ;
@ -1913,7 +1920,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
int result = msg - > exec ( ) ;
// wtf
QMessageBox : : ButtonRole role = msg - > buttonRole ( msg - > button ( ( QMessageBox : : StandardButton ) result ) ) ;
QMessageBox : : ButtonRole role =
msg - > buttonRole ( msg - > button ( ( QMessageBox : : StandardButton ) result ) ) ;
switch ( role ) {
case QMessageBox : : RejectRole :
@ -1929,11 +1937,13 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
}
}
if ( FirmwareManager : : GameRequiresFirmware ( params . program_id ) & & ! FirmwareManager : : CheckFirmwarePresence ( * system ) ) {
if ( FirmwareManager : : GameRequiresFirmware ( params . program_id ) & &
! FirmwareManager : : CheckFirmwarePresence ( * system ) ) {
QMessageBox * msg = new QMessageBox ( this ) ;
msg - > setWindowTitle ( tr ( " Game Requires Firmware " ) ) ;
msg - > setIcon ( QMessageBox : : Warning ) ;
msg - > setText ( tr ( " The game you are trying to launch requires firmware to boot or to get past the "
msg - > setText (
tr ( " The game you are trying to launch requires firmware to boot or to get past the "
" opening menu. Please <a href='https://yuzu-mirror.github.io/help/quickstart'> "
" dump and install firmware</a>, or press \" OK \" to launch anyways. " ) ) ;
@ -1941,7 +1951,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
int exec_result = msg - > exec ( ) ;
QMessageBox : : ButtonRole role = msg - > buttonRole ( msg - > button ( ( QMessageBox : : StandardButton ) exec_result ) ) ;
QMessageBox : : ButtonRole role =
msg - > buttonRole ( msg - > button ( ( QMessageBox : : StandardButton ) exec_result ) ) ;
switch ( role ) {
case QMessageBox : : RejectRole :
@ -1970,7 +1981,8 @@ bool GMainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPa
" outdated format that has been superseded by others such as NCA, NAX, XCI, or "
" NSP. Deconstructed ROM directories lack icons, metadata, and update "
" support.<br><br>For an explanation of the various Switch formats Eden supports, <a "
" href='https://eden-emulator.github.io/wiki/overview-of-switch-game-formats'>check out our "
" href='https://eden-emulator.github.io/wiki/overview-of-switch-game-formats'>check "
" out our "
" wiki</a>. This message will not be shown again. " ) ) ;
}
@ -2300,7 +2312,7 @@ void GMainWindow::OnEmulationStopped() {
discord_rpc - > Update ( ) ;
# ifdef __uni x__
# ifdef __lin ux__
Common : : Linux : : StopGamemode ( ) ;
# endif
@ -2996,7 +3008,8 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
directory = it - > second . second ;
}
QDesktopServices : : openUrl ( QUrl ( QStringLiteral ( " https://eden-emulator.github.io/game/ " ) + directory ) ) ;
QDesktopServices : : openUrl (
QUrl ( QStringLiteral ( " https://eden-emulator.github.io/game/ " ) + directory ) ) ;
}
bool GMainWindow : : CreateShortcutLink ( const std : : filesystem : : path & shortcut_path ,
@ -3485,7 +3498,7 @@ void GMainWindow::OnStartGame() {
discord_rpc - > Update ( ) ;
# ifdef __uni x__
# ifdef __lin ux__
Common : : Linux : : StartGamemode ( ) ;
# endif
}
@ -3509,7 +3522,7 @@ void GMainWindow::OnPauseGame() {
UpdateMenuState ( ) ;
AllowOSSleep ( ) ;
# ifdef __uni x__
# ifdef __lin ux__
Common : : Linux : : StopGamemode ( ) ;
# endif
}
@ -3621,7 +3634,8 @@ void GMainWindow::OnMenuReportCompatibility() {
} else {
QMessageBox : : critical (
this , tr ( " Missing yuzu Account " ) ,
tr ( " In order to submit a game compatibility test case, you must set up your web token and "
tr ( " In order to submit a game compatibility test case, you must set up your web token "
" and "
" username.<br><br/>To link your eden account, go to Emulation > Configuration "
" > "
" Web. " ) ) ;
@ -3653,8 +3667,7 @@ void GMainWindow::OnOpenFAQ() {
OpenURL ( QUrl ( QStringLiteral ( " https://eden-emu.dev " ) ) ) ;
}
void GMainWindow : : OnOpenDiscord ( )
{
void GMainWindow : : OnOpenDiscord ( ) {
OpenURL ( QUrl ( QStringLiteral ( " https://discord.gg/edenemu " ) ) ) ;
}
@ -3798,7 +3811,7 @@ void GMainWindow::OnConfigure() {
const auto old_theme = UISettings : : values . theme ;
const bool old_discord_presence = UISettings : : values . enable_discord_presence . GetValue ( ) ;
const auto old_language_index = Settings : : values . language_index . GetValue ( ) ;
# ifdef __uni x__
# ifdef __lin ux__
const bool old_gamemode = Settings : : values . enable_gamemode . GetValue ( ) ;
# endif
@ -3860,7 +3873,7 @@ void GMainWindow::OnConfigure() {
if ( UISettings : : values . enable_discord_presence . GetValue ( ) ! = old_discord_presence ) {
SetDiscordEnabled ( UISettings : : values . enable_discord_presence . GetValue ( ) ) ;
}
# ifdef __uni x__
# ifdef __lin ux__
if ( Settings : : values . enable_gamemode . GetValue ( ) ! = old_gamemode ) {
SetGamemodeEnabled ( Settings : : values . enable_gamemode . GetValue ( ) ) ;
}
@ -4185,30 +4198,26 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
}
void GMainWindow : : OnOpenRootDataFolder ( ) {
QDesktopServices : : openUrl ( QUrl (
QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : EdenDir ) ) ) ) ;
QDesktopServices : : openUrl (
QUrl ( QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : EdenDir ) ) ) ) ;
}
void GMainWindow : : OnOpenNANDFolder ( )
{
void GMainWindow : : OnOpenNANDFolder ( ) {
QDesktopServices : : openUrl ( QUrl : : fromLocalFile (
QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : NANDDir ) ) ) ) ;
}
void GMainWindow : : OnOpenSDMCFolder ( )
{
void GMainWindow : : OnOpenSDMCFolder ( ) {
QDesktopServices : : openUrl ( QUrl : : fromLocalFile (
QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : SDMCDir ) ) ) ) ;
}
void GMainWindow : : OnOpenModFolder ( )
{
void GMainWindow : : OnOpenModFolder ( ) {
QDesktopServices : : openUrl ( QUrl : : fromLocalFile (
QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : LoadDir ) ) ) ) ;
}
void GMainWindow : : OnOpenLogFolder ( )
{
void GMainWindow : : OnOpenLogFolder ( ) {
QDesktopServices : : openUrl ( QUrl : : fromLocalFile (
QString : : fromStdString ( Common : : FS : : GetEdenPathString ( Common : : FS : : EdenPath : : LogDir ) ) ) ) ;
}
@ -4243,8 +4252,7 @@ void GMainWindow::OnVerifyInstalledContents() {
}
}
void GMainWindow : : InstallFirmware ( const QString & location , bool recursive )
{
void GMainWindow : : InstallFirmware ( const QString & location , bool recursive ) {
QProgressDialog progress ( tr ( " Installing Firmware... " ) , tr ( " Cancel " ) , 0 , 100 , this ) ;
progress . setWindowModality ( Qt : : WindowModal ) ;
progress . setMinimumDuration ( 100 ) ;
@ -4281,9 +4289,11 @@ void GMainWindow::InstallFirmware(const QString &location, bool recursive)
QtProgressCallback ( 100 , 10 ) ;
if ( recursive ) {
Common : : FS : : IterateDirEntriesRecursively ( firmware_source_path , callback , Common : : FS : : DirEntryFilter : : File ) ;
Common : : FS : : IterateDirEntriesRecursively ( firmware_source_path , callback ,
Common : : FS : : DirEntryFilter : : File ) ;
} else {
Common : : FS : : IterateDirEntries ( firmware_source_path , callback , Common : : FS : : DirEntryFilter : : File ) ;
Common : : FS : : IterateDirEntries ( firmware_source_path , callback ,
Common : : FS : : DirEntryFilter : : File ) ;
}
if ( out . size ( ) < = 0 ) {
@ -4391,8 +4401,7 @@ void GMainWindow::OnInstallFirmware() {
InstallFirmware ( firmware_source_location ) ;
}
void GMainWindow : : OnInstallFirmwareFromZIP ( )
{
void GMainWindow : : OnInstallFirmwareFromZIP ( ) {
// Don't do this while emulation is running, that'd probably be a bad idea.
if ( emu_thread ! = nullptr & & emu_thread - > IsRunning ( ) ) {
return ;
@ -4442,17 +4451,18 @@ void GMainWindow::OnInstallFirmwareFromZIP()
if ( ec ) {
QMessageBox : : warning ( this , tr ( " Firmware cleanup failed " ) ,
tr ( " Failed to clean up extracted firmware cache. \n "
" Check write permissions in the system temp directory and try again. \n OS reported error: %1 " )
" Check write permissions in the system temp directory and try "
" again. \n OS reported error: %1 " )
. arg ( QString : : fromStdString ( ec . message ( ) ) ) ) ;
}
return ;
}
unzipFailed :
QMessageBox : : critical ( this , tr ( " Firmware unzip failed " ) ,
QMessageBox : : critical (
this , tr ( " Firmware unzip failed " ) ,
tr ( " Check write permissions in the system temp directory and try again. " ) ) ;
return ;
}
void GMainWindow : : OnInstallDecryptionKeys ( ) {
@ -4468,7 +4478,8 @@ void GMainWindow::OnInstallDecryptionKeys() {
return ;
}
FirmwareManager : : KeyInstallResult result = FirmwareManager : : InstallKeys ( key_source_location . toStdString ( ) , " keys " ) ;
FirmwareManager : : KeyInstallResult result =
FirmwareManager : : InstallKeys ( key_source_location . toStdString ( ) , " keys " ) ;
system - > GetFileSystemController ( ) . CreateFactories ( * vfs ) ;
game_list - > PopulateAsync ( UISettings : : values . game_dirs ) ;
@ -4479,8 +4490,7 @@ void GMainWindow::OnInstallDecryptionKeys() {
tr ( " Decryption Keys were successfully installed " ) ) ;
break ;
default :
QMessageBox : : critical (
this , tr ( " Decryption Keys install failed " ) ,
QMessageBox : : critical ( this , tr ( " Decryption Keys install failed " ) ,
tr ( FirmwareManager : : GetKeyInstallResultString ( result ) ) ) ;
break ;
}
@ -4507,8 +4517,7 @@ void GMainWindow::OnToggleStatusBar() {
statusBar ( ) - > setVisible ( ui - > action_Show_Status_Bar - > isChecked ( ) ) ;
}
void GMainWindow : : OnGameListRefresh ( )
{
void GMainWindow : : OnGameListRefresh ( ) {
// force reload add-ons etc
game_list - > ForceRefreshGameDirectory ( ) ;
}
@ -4631,8 +4640,7 @@ void GMainWindow::OnHomeMenu() {
BootGame ( filename , LibraryAppletParameters ( QLaunchId , Service : : AM : : AppletId : : QLaunch ) ) ;
}
void GMainWindow : : OnInitialSetup ( )
{
void GMainWindow : : OnInitialSetup ( ) {
constexpr u64 Starter = static_cast < u64 > ( Service : : AM : : AppletProgramId : : Starter ) ;
auto bis_system = system - > GetFileSystemController ( ) . GetSystemNANDContents ( ) ;
if ( ! bis_system ) {
@ -4655,18 +4663,15 @@ void GMainWindow::OnInitialSetup()
BootGame ( filename , LibraryAppletParameters ( Starter , Service : : AM : : AppletId : : Starter ) ) ;
}
void GMainWindow : : OnCreateHomeMenuDesktopShortcut ( )
{
void GMainWindow : : OnCreateHomeMenuDesktopShortcut ( ) {
OnCreateHomeMenuShortcut ( GameListShortcutTarget : : Desktop ) ;
}
void GMainWindow : : OnCreateHomeMenuApplicationMenuShortcut ( )
{
void GMainWindow : : OnCreateHomeMenuApplicationMenuShortcut ( ) {
OnCreateHomeMenuShortcut ( GameListShortcutTarget : : Applications ) ;
}
std : : filesystem : : path GMainWindow : : GetEdenCommand ( )
{
std : : filesystem : : path GMainWindow : : GetEdenCommand ( ) {
std : : filesystem : : path command ;
QString appimage = QString : : fromLocal8Bit ( getenv ( " APPIMAGE " ) ) ;
@ -4685,8 +4690,7 @@ std::filesystem::path GMainWindow::GetEdenCommand()
return command ;
}
std : : filesystem : : path GMainWindow : : GetShortcutPath ( GameListShortcutTarget target )
{
std : : filesystem : : path GMainWindow : : GetShortcutPath ( GameListShortcutTarget target ) {
std : : filesystem : : path shortcut_path { } ;
if ( target = = GameListShortcutTarget : : Desktop ) {
shortcut_path =
@ -4699,7 +4703,9 @@ std::filesystem::path GMainWindow::GetShortcutPath(GameListShortcutTarget target
return shortcut_path ;
}
void GMainWindow : : CreateShortcut ( const std : : string & game_path , const u64 program_id , const std : : string & game_title_ , GameListShortcutTarget target , std : : string arguments_ , const bool needs_title ) {
void GMainWindow : : CreateShortcut ( const std : : string & game_path , const u64 program_id ,
const std : : string & game_title_ , GameListShortcutTarget target ,
std : : string arguments_ , const bool needs_title ) {
// Get path to yuzu executable
std : : filesystem : : path command = GetEdenCommand ( ) ;
@ -4780,8 +4786,8 @@ void GMainWindow::CreateShortcut(const std::string &game_path, const u64 program
const std : : string categories = " Game;Emulator;Qt; " ;
const std : : string keywords = " Switch;Nintendo; " ;
if ( GMainWindow : : CreateShortcutLink ( shortcut_path , comment , out_icon_path , command ,
arguments , categories , keywords , game_title ) ) {
if ( GMainWindow : : CreateShortcutLink ( shortcut_path , comment , out_icon_path , command , arguments ,
categories , keywords , game_title ) ) {
GMainWindow : : CreateShortcutMessagesGUI ( this , GMainWindow : : CREATE_SHORTCUT_MSGBOX_SUCCESS ,
qgame_title ) ;
return ;
@ -4790,8 +4796,7 @@ void GMainWindow::CreateShortcut(const std::string &game_path, const u64 program
qgame_title ) ;
}
void GMainWindow : : OnCreateHomeMenuShortcut ( GameListShortcutTarget target )
{
void GMainWindow : : OnCreateHomeMenuShortcut ( GameListShortcutTarget target ) {
constexpr u64 QLaunchId = static_cast < u64 > ( Service : : AM : : AppletProgramId : : QLaunch ) ;
auto bis_system = system - > GetFileSystemController ( ) . GetSystemNANDContents ( ) ;
if ( ! bis_system ) {
@ -4884,8 +4889,8 @@ void GMainWindow::OnEmulatorUpdateAvailable() {
update_prompt . setIcon ( QMessageBox : : Information ) ;
update_prompt . addButton ( QMessageBox : : Yes ) ;
update_prompt . addButton ( QMessageBox : : Ignore ) ;
update_prompt . setText ( tr ( " Update %1 for Eden is available. \n Would you like to download it? " )
. arg ( version_string ) ) ;
update_prompt . setText (
tr ( " Update %1 for Eden is available. \n Would you like to download it? " ) . arg ( version_string ) ) ;
update_prompt . exec ( ) ;
if ( update_prompt . button ( QMessageBox : : Yes ) = = update_prompt . clickedButton ( ) ) {
QDesktopServices : : openUrl (
@ -5015,7 +5020,8 @@ void GMainWindow::UpdateStatusBar() {
}
game_fps_label - > setText (
tr ( " Game: %1 FPS " ) . arg ( std : : round ( results . average_game_fps ) , 0 , ' f ' , 0 ) + tr ( Settings : : values . use_speed_limit ? " " : " (Unlocked) " ) ) ;
tr ( " Game: %1 FPS " ) . arg ( std : : round ( results . average_game_fps ) , 0 , ' f ' , 0 ) +
tr ( Settings : : values . use_speed_limit ? " " : " (Unlocked) " ) ) ;
emu_frametime_label - > setText ( tr ( " Frame: %1 ms " ) . arg ( results . frametime * 1000.0 , 0 , ' f ' , 2 ) ) ;
@ -5142,24 +5148,21 @@ void GMainWindow::OnMouseActivity() {
void GMainWindow : : OnCheckFirmwareDecryption ( ) {
system - > GetFileSystemController ( ) . CreateFactories ( * vfs ) ;
if ( ! ContentManager : : AreKeysPresent ( ) ) {
QMessageBox : : warning (
this , tr ( " Derivation Components Missing " ) ,
QMessageBox : : warning ( this , tr ( " Derivation Components Missing " ) ,
tr ( " Encryption keys are missing. " ) ) ;
}
SetFirmwareVersion ( ) ;
UpdateMenuState ( ) ;
}
void GMainWindow : : OnCheckFirmware ( )
{
void GMainWindow : : OnCheckFirmware ( ) {
auto result = FirmwareManager : : VerifyFirmware ( * system . get ( ) ) ;
switch ( result ) {
case FirmwareManager : : FirmwareGood :
break ;
default :
QMessageBox : : warning (
this , tr ( " Firmware Read Error " ) ,
QMessageBox : : warning ( this , tr ( " Firmware Read Error " ) ,
tr ( FirmwareManager : : GetFirmwareCheckString ( result ) ) ) ;
break ;
}
@ -5476,7 +5479,7 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
discord_rpc - > Update ( ) ;
}
# ifdef __uni x__
# ifdef __lin ux__
void GMainWindow : : SetGamemodeEnabled ( bool state ) {
if ( emulation_running ) {
Common : : Linux : : SetGamemodeState ( state ) ;