diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index 62b05532e1..1015fe80c9 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -1661,14 +1661,21 @@ int menu_set_settings(void *data, unsigned setting, unsigned action) } break; case RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST: - g_settings.pause_nonactive = !g_settings.pause_nonactive; + if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT) + g_settings.pause_nonactive = !g_settings.pause_nonactive; + else if (action == RGUI_ACTION_START) + g_settings.pause_nonactive = false; break; case RGUI_SETTINGS_WINDOW_COMPOSITING_ENABLE: - g_settings.video.disable_composition = !g_settings.video.disable_composition; - - if (!g_settings.video.disable_composition) + if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT) { - /* TODO/FIXME - implement toggling at runtime */ + g_settings.video.disable_composition = !g_settings.video.disable_composition; + rarch_set_fullscreen(g_settings.video.fullscreen); + } + else if (action == RGUI_ACTION_START) + { + g_settings.video.disable_composition = false; + rarch_set_fullscreen(g_settings.video.fullscreen); } break; default: diff --git a/gfx/gfx_common.c b/gfx/gfx_common.c index 14736b73be..241f35261d 100644 --- a/gfx/gfx_common.c +++ b/gfx/gfx_common.c @@ -70,7 +70,8 @@ bool gfx_get_fps(char *buf, size_t size, char *buf_fps, size_t size_fps) // We only load this library once, so we let it be unloaded at application shutdown, // since unloading it early seems to cause issues on some systems. -static dylib_t dwmlib = NULL; +static dylib_t dwmlib; +static bool dwm_composition_disabled; static void gfx_dwm_shutdown(void) { @@ -81,9 +82,9 @@ static void gfx_dwm_shutdown(void) } } -void gfx_set_dwm(void) +static void gfx_init_dwm(void) { - static bool inited = false; + static bool inited; if (inited) return; inited = true; @@ -102,8 +103,15 @@ void gfx_set_dwm(void) RARCH_LOG("Setting multimedia scheduling for DWM.\n"); mmcss(TRUE); } +} - if (!g_settings.video.disable_composition) +void gfx_set_dwm(void) +{ + gfx_init_dwm(); + if (!dwmlib) + return; + + if (g_settings.video.disable_composition == dwm_composition_disabled) return; HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition"); @@ -113,9 +121,10 @@ void gfx_set_dwm(void) return; } - HRESULT ret = composition_enable(0); + HRESULT ret = composition_enable(!g_settings.video.disable_composition); if (FAILED(ret)) RARCH_ERR("Failed to set composition state ...\n"); + dwm_composition_disabled = g_settings.video.disable_composition; } #endif