diff --git a/general.h b/general.h index 340ad1fdcc..51ed03ce1d 100644 --- a/general.h +++ b/general.h @@ -179,6 +179,11 @@ struct settings bool force_srgb_disable; } video; + struct + { + bool menubar_enable; + } ui; + #ifdef HAVE_MENU struct { diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index fed5c0c9c0..ffc023f3a0 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -586,7 +586,7 @@ static bool d3d_construct(d3d_video_t *d3d, ); #if defined(HAVE_WINDOW) && !defined(_XBOX) - if (!info->fullscreen) + if (!info->fullscreen && g_settings.ui.menubar_enable) { RECT rc_temp = {0, 0, win_height, 0x7FFF}; SetMenu(d3d->hWnd, LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index f59d864a7c..f3287df2b7 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -98,6 +98,7 @@ LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, } return 0; case WM_COMMAND: + if (g_settings.ui.menubar_enable) { d3d_video_t *d3d = (d3d_video_t*)driver.video_data; HWND d3dr = d3d->hWnd; diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index f4da3e377b..f36dc0f045 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -271,11 +271,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, } return 0; case WM_COMMAND: - { - LRESULT ret = win32_menu_loop(g_hwnd, wparam); - } - + if (g_settings.ui.menubar_enable) + { + LRESULT ret = win32_menu_loop(g_hwnd, wparam); + } + break; } + if (dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; return DefWindowProc(hwnd, message, wparam, lparam); @@ -509,7 +511,7 @@ static bool gfx_ctx_wgl_set_video_mode(void *data, if (!fullscreen || windowed_full) { - if (!fullscreen) + if (!fullscreen && g_settings.ui.menubar_enable) { RECT rc_temp = {0, 0, height, 0x7FFF}; SetMenu(g_hwnd, LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); diff --git a/settings.c b/settings.c index fd84d70956..74d5f47625 100644 --- a/settings.c +++ b/settings.c @@ -1287,6 +1287,7 @@ static bool config_load_file(const char *path, bool set_defaults) *g_settings.libretro = '\0'; } + CONFIG_GET_BOOL(ui.menubar_enable, "ui_menubar_enable"); CONFIG_GET_BOOL(fps_show, "fps_show"); CONFIG_GET_BOOL(fps_monitor_enable, "fps_monitor_enable"); CONFIG_GET_BOOL(load_dummy_on_core_shutdown, "load_dummy_on_core_shutdown"); @@ -1769,6 +1770,7 @@ bool config_save_file(const char *path) config_set_bool(conf, "load_dummy_on_core_shutdown", g_settings.load_dummy_on_core_shutdown); config_set_bool(conf, "fps_show", g_settings.fps_show); + config_set_bool(conf, "ui_menubar_enable", g_settings.ui.menubar_enable); config_set_bool(conf, "fps_monitor_enable", g_settings.fps_monitor_enable); config_set_path(conf, "libretro_path", g_settings.libretro); config_set_path(conf, "libretro_directory", g_settings.libretro_directory); diff --git a/settings_data.c b/settings_data.c index 0498f4eb87..0ce9c22b90 100644 --- a/settings_data.c +++ b/settings_data.c @@ -5326,7 +5326,7 @@ static bool setting_data_append_list_ui_options( CONFIG_BOOL( g_settings.video.disable_composition, "video_disable_composition", - "Window Compositing Disable", + "Window Compositing Disable Hint", disable_composition, "OFF", "ON", @@ -5340,7 +5340,7 @@ static bool setting_data_append_list_ui_options( CONFIG_BOOL( g_settings.pause_nonactive, "pause_nonactive", - "Window Unfocus Pause", + "Window Unfocus Pause Hint", pause_nonactive, "OFF", "ON", @@ -5349,6 +5349,18 @@ static bool setting_data_append_list_ui_options( general_write_handler, general_read_handler); + CONFIG_BOOL( + g_settings.ui.menubar_enable, + "ui_menubar_enable", + "Menubar Enable Hint", + true, + "OFF", + "ON", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + END_SUB_GROUP(list, list_info); END_GROUP(list, list_info);