Skip to content

Commit 67a46ae

Browse files
Merge pull request #17984 from libretro/revert-17980-master
Revert "Kiosk Mode Hotkey and Bug Fix ( For Empty Main Menu )"
2 parents 5aefb76 + c936026 commit 67a46ae

File tree

15 files changed

+21
-225
lines changed

15 files changed

+21
-225
lines changed

command.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ enum event_command
4343
{
4444
CMD_SPECIAL = -1,
4545
CMD_EVENT_NONE = 0,
46-
/* Toggle Kiosk Mode*/
47-
CMD_EVENT_KIOSK,
4846
/* Resets RetroArch. */
4947
CMD_EVENT_RESET,
5048
CMD_EVENT_SET_PER_GAME_RESOLUTION,
@@ -458,7 +456,6 @@ static const struct cmd_map map[] = {
458456
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
459457
{ "QUIT", RARCH_QUIT_KEY },
460458
{ "CLOSE_CONTENT", RARCH_CLOSE_CONTENT_KEY },
461-
{ "KIOSK_MODE", RARCH_KIOSK_MODE },
462459
{ "RESET", RARCH_RESET },
463460

464461
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },

config.def.keybinds.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,6 @@ static const struct retro_keybind retro_keybinds_1[] = {
570570
RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0,
571571
true
572572
},
573-
{
574-
NULL, NULL,
575-
AXIS_NONE, AXIS_NONE,
576-
MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_UNKNOWN,
577-
RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0,
578-
true
579-
},
580573
{
581574
NULL, NULL,
582575
AXIS_NONE, AXIS_NONE,
@@ -1216,13 +1209,6 @@ static const struct retro_keybind retro_keybinds_1[] = {
12161209
RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0,
12171210
true
12181211
},
1219-
{
1220-
NULL, NULL,
1221-
AXIS_NONE, AXIS_NONE,
1222-
MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_UNKNOWN,
1223-
RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0,
1224-
true
1225-
},
12261212
{
12271213
NULL, NULL,
12281214
AXIS_NONE, AXIS_NONE,
@@ -1872,13 +1858,6 @@ static const struct retro_keybind retro_keybinds_1[] = {
18721858
RARCH_UI_COMPANION_TOGGLE, NO_BTN, NO_BTN, 0,
18731859
true
18741860
},
1875-
{
1876-
NULL, NULL,
1877-
AXIS_NONE, AXIS_NONE,
1878-
MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK, RETROK_F5,
1879-
RARCH_KIOSK_MODE, NO_BTN, NO_BTN, 0,
1880-
true
1881-
},
18821861
{
18831862
NULL, NULL,
18841863
AXIS_NONE, AXIS_NONE,

configuration.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
345345
DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY),
346346
#endif
347347
DECLARE_META_BIND(2, close_content, RARCH_CLOSE_CONTENT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_CLOSE_CONTENT_KEY),
348-
DECLARE_META_BIND(2, kiosk_toggle, RARCH_KIOSK_MODE, MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK),
349348
DECLARE_META_BIND(2, reset, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET),
350349
DECLARE_META_BIND(1, toggle_fast_forward, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY),
351350
DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY),

gfx/common/win32_common.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,6 @@ static LRESULT win32_menu_loop(HWND owner, WPARAM wparam)
802802
win32_load_content_from_gui(win32_file);
803803
}
804804
break;
805-
case ID_M_KIOSK:
806-
command_event(CMD_EVENT_KIOSK, NULL);
807805
case ID_M_RESET:
808806
command_event(CMD_EVENT_RESET, NULL);
809807
break;
@@ -2030,8 +2028,6 @@ static enum msg_hash_enums menu_id_to_label_enum(unsigned int menuId)
20302028
{
20312029
case ID_M_LOAD_CONTENT:
20322030
return MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST;
2033-
case ID_M_KIOSK:
2034-
return MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK;
20352031
case ID_M_RESET:
20362032
return MENU_ENUM_LABEL_VALUE_RESTART_CONTENT;
20372033
case ID_M_QUIT:
@@ -2072,8 +2068,6 @@ static unsigned int menu_id_to_meta_key(unsigned int menu_id)
20722068
{
20732069
switch (menu_id)
20742070
{
2075-
case ID_M_KIOSK:
2076-
return RARCH_KIOSK_MODE;
20772071
case ID_M_RESET:
20782072
return RARCH_RESET;
20792073
case ID_M_QUIT:

input/input_defines.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ enum
126126
RARCH_MENU_TOGGLE,
127127
RARCH_QUIT_KEY,
128128
RARCH_CLOSE_CONTENT_KEY,
129-
RARCH_KIOSK_MODE,
130129
RARCH_RESET,
131130
RARCH_FAST_FORWARD_KEY,
132131
RARCH_FAST_FORWARD_HOLD_KEY,

intl/msg_hash_us.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16115,14 +16115,6 @@ MSG_HASH(
1611516115
MENU_ENUM_LABEL_VALUE_PAL60_ENABLE,
1611616116
"Use PAL60 Mode"
1611716117
)
16118-
MSG_HASH(
16119-
MENU_ENUM_LABEL_VALUE_INPUT_META_KIOSK,
16120-
"Kiosk Mode (Toggle)"
16121-
)
16122-
MSG_HASH(
16123-
MENU_ENUM_SUBLABEL_INPUT_META_KIOSK,
16124-
"Toggles Kiosk Mode."
16125-
)
1612616118
MSG_HASH(
1612716119
MENU_ENUM_LABEL_VALUE_INPUT_META_RESTART_KEY,
1612816120
"Restart RetroArch"

media/rarch.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ IDR_MENU MENU
4747
MENUITEM "Load State", ID_M_LOAD_STATE
4848
MENUITEM "Save State", ID_M_SAVE_STATE
4949
}
50-
MENUITEM "Kiosk", ID_M_KIOSK
5150
MENUITEM "Reset", ID_M_RESET
5251
MENUITEM "Pause Toggle", ID_M_PAUSE_TOGGLE
5352
MENUITEM "Menu Toggle", ID_M_MENU_TOGGLE

menu/drivers/xmb.c

Lines changed: 18 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,6 @@ typedef struct xmb_handle
473473

474474
/* Whether to show entry index for current list */
475475
bool entry_idx_enabled;
476-
477-
/* Kiosk Mode Fix - Makes sure we only call our function once after menu is ready */
478-
bool is_kiosk_init;
479-
480476
} xmb_handle_t;
481477

482478
static float xmb_scale_mod[8] = {
@@ -5860,17 +5856,10 @@ static enum menu_action xmb_parse_menu_entry_action(
58605856
else
58615857
{
58625858
/* Jump to Main Menu */
5863-
settings_t *settings = config_get_ptr();
58645859
size_t i = 0;
58655860
size_t current_tab = xmb->categories_selection_ptr;
5861+
58665862
menu_entry_t entry;
5867-
5868-
/* Kiosk Mode Fix - Only jump to Main Menu if not in Kiosk Mode!*/
5869-
if(settings->bools.kiosk_mode_enable)
5870-
{
5871-
return MENU_ACTION_NOOP;
5872-
}
5873-
58745863
MENU_ENTRY_INITIALIZE(entry);
58755864
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
58765865

@@ -6448,7 +6437,6 @@ static bool xmb_context_reset_textures(
64486437
const char *iconpath,
64496438
unsigned menu_xmb_theme)
64506439
{
6451-
settings_t *settings = config_get_ptr();
64526440
unsigned i;
64536441

64546442
for (i = 0; i < XMB_TEXTURE_LAST; i++)
@@ -6519,13 +6507,11 @@ static bool xmb_context_reset_textures(
65196507
}
65206508
}
65216509
}
6522-
/* Kiosk Mode Fix - Hide Main Menu Icon if kiosk mode is enabled */
6523-
if (!settings->bools.kiosk_mode_enable)
6524-
{
6525-
xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
6526-
xmb->main_menu_node.alpha = xmb->categories_active_alpha;
6527-
xmb->main_menu_node.zoom = xmb->categories_active_zoom;
6528-
}
6510+
6511+
xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
6512+
xmb->main_menu_node.alpha = xmb->categories_active_alpha;
6513+
xmb->main_menu_node.zoom = xmb->categories_active_zoom;
6514+
65296515
xmb->settings_tab_node.icon = xmb->textures.list[XMB_TEXTURE_SETTINGS];
65306516
xmb->settings_tab_node.alpha = xmb->categories_active_alpha;
65316517
xmb->settings_tab_node.zoom = xmb->categories_active_zoom;
@@ -8732,10 +8718,7 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
87328718
xmb->depth = 1;
87338719
xmb->old_depth = 1;
87348720
xmb->alpha = 1.0f;
8735-
8736-
/* Kiosk Mode Fix */
8737-
xmb->is_kiosk_init = false;
8738-
8721+
87398722
xmb_refresh_system_tabs_list(xmb);
87408723

87418724
for (i = 0; i < XMB_TAB_MAX_LENGTH; i++)
@@ -8804,45 +8787,6 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
88048787
return NULL;
88058788
}
88068789

8807-
/* Kiosk Mode Fix */
8808-
static void xmb_kiosk_mode_fix(xmb_handle_t *xmb)
8809-
{
8810-
settings_t *settings = config_get_ptr();
8811-
if (settings->bools.kiosk_mode_enable)
8812-
{
8813-
/* Only jump if we have a Horizontal Menu ( if Play lists Tab is not empty ! ) */
8814-
/* If we have no playlists on the playlists tab, disable Kiosk mode and reset !*/
8815-
if((unsigned)xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL) <= 0)
8816-
{
8817-
/* Disable Kiosk Mode ( Prevents Crash when kiosk mode enabled with no playlists ) */
8818-
settings->bools.kiosk_mode_enable = false;
8819-
/* Re-Enable Main Menu Icon! */
8820-
xmb->main_menu_node.icon = xmb->textures.list[XMB_TEXTURE_MAIN_MENU];
8821-
xmb->main_menu_node.alpha = xmb->categories_active_alpha;
8822-
xmb->main_menu_node.zoom = xmb->categories_active_zoom;
8823-
/* Refresh list */
8824-
xmb_refresh_system_tabs_list(xmb);
8825-
}
8826-
else
8827-
{
8828-
/* Jump one Categorie Right after init ( "hides" main menu ) */
8829-
/* Only happens once on init */
8830-
if (!xmb->is_kiosk_init)
8831-
{
8832-
struct menu_state *menu_st = menu_state_get_ptr();
8833-
menu_list_t *menu_list = menu_st->entries.list;
8834-
8835-
menu_entry_t entry;
8836-
MENU_ENTRY_INITIALIZE(entry);
8837-
menu_entry_get(&entry, 0, menu_st->selection_ptr, NULL, true);
8838-
8839-
xmb_menu_entry_action(xmb, &entry, menu_st->selection_ptr, MENU_ACTION_RIGHT);
8840-
xmb->is_kiosk_init = true;
8841-
}
8842-
}
8843-
}
8844-
}
8845-
88468790
static void xmb_free(void *data)
88478791
{
88488792
xmb_handle_t *xmb = (xmb_handle_t*)data;
@@ -9060,7 +9004,6 @@ static void xmb_list_cache(void *data, enum menu_list_type type,
90609004
file_list_t *menu_stack = MENU_LIST_GET(menu_list, 0);
90619005
file_list_t *selection_buf = MENU_LIST_GET_SELECTION(menu_list, 0);
90629006
size_t selection = menu_st->selection_ptr;
9063-
settings_t *settings = config_get_ptr();
90649007
unsigned horizontal_list_size = (xmb->show_playlist_tabs)
90659008
? (unsigned)xmb_list_get_size(xmb, MENU_LIST_HORIZONTAL)
90669009
: 0;
@@ -9110,54 +9053,23 @@ static void xmb_list_cache(void *data, enum menu_list_type type,
91109053
switch (action)
91119054
{
91129055
case MENU_ACTION_LEFT:
9113-
/* Kiosk Mode Fix - Only allow categorie movement between idx 1 and last instead of 0 ( skips main menu ) */
9114-
if (settings->bools.kiosk_mode_enable)
9056+
if (xmb->categories_selection_ptr == 0)
91159057
{
9116-
if (xmb->categories_selection_ptr == 1)
9117-
{
9118-
xmb->categories_selection_ptr = list_size;
9119-
xmb->categories_active_idx = (unsigned)(list_size - 1);
9120-
}
9121-
else
9122-
xmb->categories_selection_ptr--;
9123-
break;
9058+
xmb->categories_selection_ptr = list_size;
9059+
xmb->categories_active_idx = (unsigned)(list_size - 1);
91249060
}
91259061
else
9126-
{
9127-
if (xmb->categories_selection_ptr == 0)
9128-
{
9129-
xmb->categories_selection_ptr = list_size;
9130-
xmb->categories_active_idx = (unsigned)(list_size - 1);
9131-
}
9132-
else
9133-
xmb->categories_selection_ptr--;
9134-
break;
9135-
}
9062+
xmb->categories_selection_ptr--;
9063+
break;
91369064
default:
9137-
/* Kiosk Mode Fix - Only allow categorie movement between idx 1 and last instead of 0 ( skips main menu ) */
9138-
if (settings->bools.kiosk_mode_enable)
9065+
if (xmb->categories_selection_ptr == list_size)
91399066
{
9140-
if (xmb->categories_selection_ptr == list_size)
9141-
{
9142-
xmb->categories_selection_ptr = 1;
9143-
xmb->categories_active_idx = 2;
9144-
}
9145-
else
9146-
xmb->categories_selection_ptr++;
9147-
break;
9067+
xmb->categories_selection_ptr = 0;
9068+
xmb->categories_active_idx = 1;
91489069
}
91499070
else
9150-
{
9151-
if (xmb->categories_selection_ptr == list_size)
9152-
{
9153-
xmb->categories_selection_ptr = 0;
9154-
xmb->categories_active_idx = 1;
9155-
}
9156-
else
9157-
xmb->categories_selection_ptr++;
9158-
break;
9159-
}
9160-
9071+
xmb->categories_selection_ptr++;
9072+
break;
91619073
}
91629074

91639075
stack_size = menu_stack->size;
@@ -9295,10 +9207,7 @@ static void xmb_toggle(void *userdata, bool menu_on)
92959207
xmb_fade_out(xmb);
92969208
return;
92979209
}
9298-
9299-
/* Kiosk Mode Fix */
9300-
xmb_kiosk_mode_fix(xmb);
9301-
9210+
93029211
/* Have to reset this, otherwise savestate
93039212
* thumbnail won't update after selecting
93049213
* 'save state' option */

menu/menu_displaylist.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9578,8 +9578,8 @@ unsigned menu_displaylist_build_list(
95789578
build_list[i].checked = settings->bools.settings_show_file_browser;
95799579
break;
95809580
case MENU_ENUM_LABEL_MENU_KIOSK_MODE_PASSWORD:
9581-
/* Kiosk Mode Fix - Always show Kiosk Password Settings Option */
9582-
build_list[i].checked = true;
9581+
if (kiosk_mode_enable)
9582+
build_list[i].checked = true;
95839583
break;
95849584
case MENU_ENUM_LABEL_MENU_SCREENSAVER_TIMEOUT:
95859585
if (menu_screensaver_supported)
@@ -15408,20 +15408,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
1540815408
#endif
1540915409

1541015410
info->flags |= MD_FLAG_NEED_PUSH;
15411-
/* Kiosk Mode Fix - Add empty entry if list is empty */
15412-
if(info->list->size <= 0 || settings->bools.kiosk_mode_enable)
15413-
{
15414-
menu_entries_clear(info->list);
15415-
menu_entries_append(info->list,
15416-
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS),
15417-
msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS),
15418-
MENU_ENUM_LABEL_NO_ITEMS,
15419-
MENU_SETTING_NO_ITEM, 0, 0, NULL);
15420-
15421-
info->flags |= MD_FLAG_NEED_REFRESH
15422-
| MD_FLAG_NEED_PUSH;
15423-
break;
15424-
}
1542515411
}
1542615412
break;
1542715413
case DISPLAYLIST_HELP:

menu/menu_setting.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18608,8 +18608,7 @@ static bool setting_append_list(
1860818608
(*list)[list_info->index - 1].action_ok = setting_bool_action_left_with_refresh;
1860918609
(*list)[list_info->index - 1].action_left = setting_bool_action_left_with_refresh;
1861018610
(*list)[list_info->index - 1].action_right = setting_bool_action_right_with_refresh;
18611-
MENU_SETTINGS_LIST_CURRENT_ADD_CMD(list, list_info, CMD_EVENT_RESTART_RETROARCH);/* Kiosk Mode Fix - RESTART RETROARCH UPON SETTING KIOSK MODE!*/
18612-
18611+
1861318612
CONFIG_STRING(
1861418613
list, list_info,
1861518614
settings->paths.kiosk_mode_password,

0 commit comments

Comments
 (0)