mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 04:20:28 +00:00
Reinit driver on composition change.
This commit is contained in:
parent
b83bce794f
commit
107c07c05d
@ -1661,14 +1661,21 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST:
|
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;
|
break;
|
||||||
case RGUI_SETTINGS_WINDOW_COMPOSITING_ENABLE:
|
case RGUI_SETTINGS_WINDOW_COMPOSITING_ENABLE:
|
||||||
g_settings.video.disable_composition = !g_settings.video.disable_composition;
|
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT)
|
||||||
|
|
||||||
if (!g_settings.video.disable_composition)
|
|
||||||
{
|
{
|
||||||
/* 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;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -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,
|
// 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.
|
// 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)
|
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)
|
if (inited)
|
||||||
return;
|
return;
|
||||||
inited = true;
|
inited = true;
|
||||||
@ -102,8 +103,15 @@ void gfx_set_dwm(void)
|
|||||||
RARCH_LOG("Setting multimedia scheduling for DWM.\n");
|
RARCH_LOG("Setting multimedia scheduling for DWM.\n");
|
||||||
mmcss(TRUE);
|
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;
|
return;
|
||||||
|
|
||||||
HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition");
|
HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition");
|
||||||
@ -113,9 +121,10 @@ void gfx_set_dwm(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT ret = composition_enable(0);
|
HRESULT ret = composition_enable(!g_settings.video.disable_composition);
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
RARCH_ERR("Failed to set composition state ...\n");
|
RARCH_ERR("Failed to set composition state ...\n");
|
||||||
|
dwm_composition_disabled = g_settings.video.disable_composition;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user