diff --git a/config.def.h b/config.def.h index d76e32f1a1..1be2739e9f 100644 --- a/config.def.h +++ b/config.def.h @@ -757,6 +757,8 @@ static const bool ui_companion_start_on_boot = false; static const bool ui_companion_start_on_boot = true; #endif +static const bool ui_companion_enable = false; + #if defined(ANDROID) #if defined(ANDROID_ARM) static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"; diff --git a/configuration.c b/configuration.c index 95fbb12edf..583b0d24de 100644 --- a/configuration.c +++ b/configuration.c @@ -612,6 +612,7 @@ static void config_set_defaults(void) #endif settings->ui.companion_start_on_boot = ui_companion_start_on_boot; + settings->ui.companion_enable = ui_companion_enable; settings->ui.menubar_enable = true; settings->ui.suspend_screensaver_enable = true; @@ -1436,6 +1437,7 @@ static bool config_load_file(const char *path, bool set_defaults) CONFIG_GET_BOOL_BASE(conf, settings, input.input_descriptor_hide_unbound, "input_descriptor_hide_unbound"); CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_start_on_boot, "ui_companion_start_on_boot"); + CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_enable, "ui_companion_enable"); config_get_path(conf, "core_updater_buildbot_url", settings->network.buildbot_url, sizeof(settings->network.buildbot_url)); @@ -2532,6 +2534,7 @@ bool config_save_file(const char *path) config_set_float(conf, "input_axis_threshold", settings->input.axis_threshold); config_set_bool(conf, "ui_companion_start_on_boot", settings->ui.companion_start_on_boot); + config_set_bool(conf, "ui_companion_enable", settings->ui.companion_enable); config_set_bool(conf, "video_gpu_record", settings->video.gpu_record); config_set_bool(conf, "input_remap_binds_enable", settings->input.remap_binds_enable); diff --git a/configuration.h b/configuration.h index 58744288c9..1baa841068 100644 --- a/configuration.h +++ b/configuration.h @@ -112,6 +112,7 @@ typedef struct settings bool menubar_enable; bool suspend_screensaver_enable; bool companion_start_on_boot; + bool companion_enable; } ui; #ifdef HAVE_MENU diff --git a/menu/intl/menu_hash_us.c b/menu/intl/menu_hash_us.c index 006ca9a878..d09d314529 100644 --- a/menu/intl/menu_hash_us.c +++ b/menu/intl/menu_hash_us.c @@ -290,6 +290,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash) return "pause_nonactive"; case MENU_LABEL_UI_COMPANION_START_ON_BOOT: return "ui_companion_start_on_boot"; + case MENU_LABEL_UI_COMPANION_ENABLE: + return "ui_companion_enable"; case MENU_LABEL_UI_MENUBAR_ENABLE: return "ui_menubar_enable"; case MENU_LABEL_ARCHIVE_MODE: @@ -1008,6 +1010,8 @@ const char *menu_hash_to_str_us(uint32_t hash) return "Don't run in background"; case MENU_LABEL_VALUE_UI_COMPANION_START_ON_BOOT: return "UI Companion Start On Boot"; + case MENU_LABEL_VALUE_UI_COMPANION_ENABLE: + return "UI Companion Enable"; case MENU_LABEL_VALUE_UI_MENUBAR_ENABLE: return "Menubar"; case MENU_LABEL_VALUE_ARCHIVE_MODE: diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 7fc2f8b6e9..41e2c8b382 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -22,6 +22,9 @@ extern "C" { #endif +#define MENU_LABEL_UI_COMPANION_ENABLE 0xb2d7a20cU +#define MENU_LABEL_VALUE_UI_COMPANION_ENABLE 0xee4933ceU + #define MENU_LABEL_CHEEVOS_TEST_UNOFFICIAL 0xa1ae28f0U #define MENU_LABEL_VALUE_CHEEVOS_TEST_UNOFFICIAL 0x0698e665U diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 2fe60afa29..bb48797d83 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5942,6 +5942,21 @@ static bool setting_append_list_ui_options( parent_group, general_write_handler, general_read_handler); + + CONFIG_BOOL( + list, list_info, + &settings->ui.companion_enable, + menu_hash_to_str(MENU_LABEL_UI_COMPANION_ENABLE), + menu_hash_to_str(MENU_LABEL_VALUE_UI_COMPANION_ENABLE), + ui_companion_enable, + menu_hash_to_str(MENU_VALUE_OFF), + menu_hash_to_str(MENU_VALUE_ON), + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); CONFIG_BOOL( list, list_info, diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index b0b0e59ff2..756c1bd4c6 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -46,11 +46,10 @@ void apple_rarch_exited(void); static void rarch_enable_ui(void) { + bool boolean = true; #ifdef HAVE_AVFOUNDATION [[RetroArch_iOS get] supportOtherAudioSessions]; #endif - - bool boolean = true; ui_companion_set_foreground(true);