mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 00:40:09 +00:00
fix fullscreen=>windowed when remember window positions is on
This commit is contained in:
parent
c7b3b0f784
commit
a7e4d8359b
@ -2745,9 +2745,12 @@ TODO: Add a setting for these tweaks */
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool new_fullscreen_state = !settings->bools.video_fullscreen
|
bool new_fullscreen_state = !settings->bools.video_fullscreen
|
||||||
&& !retroarch_is_forced_fullscreen();
|
&& !retroarch_is_forced_fullscreen();
|
||||||
|
|
||||||
if (!video_driver_has_windowed())
|
if (!video_driver_has_windowed())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
retroarch_set_switching_display_mode();
|
||||||
|
|
||||||
/* we toggled manually, write the new value to settings */
|
/* we toggled manually, write the new value to settings */
|
||||||
configuration_set_bool(settings, settings->bools.video_fullscreen,
|
configuration_set_bool(settings, settings->bools.video_fullscreen,
|
||||||
new_fullscreen_state);
|
new_fullscreen_state);
|
||||||
@ -2763,6 +2766,8 @@ TODO: Add a setting for these tweaks */
|
|||||||
video_driver_hide_mouse();
|
video_driver_hide_mouse();
|
||||||
else
|
else
|
||||||
video_driver_show_mouse();
|
video_driver_show_mouse();
|
||||||
|
|
||||||
|
retroarch_unset_switching_display_mode();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_COMMAND_DEINIT:
|
case CMD_EVENT_COMMAND_DEINIT:
|
||||||
|
@ -657,7 +657,7 @@ static void win32_save_position(void)
|
|||||||
}
|
}
|
||||||
if (settings && settings->bools.video_window_save_positions)
|
if (settings && settings->bools.video_window_save_positions)
|
||||||
{
|
{
|
||||||
if (!settings->bools.video_fullscreen && !retroarch_is_forced_fullscreen())
|
if (!settings->bools.video_fullscreen && !retroarch_is_forced_fullscreen() && !retroarch_is_switching_display_mode())
|
||||||
{
|
{
|
||||||
settings->uints.window_position_x = g_win32_pos_x;
|
settings->uints.window_position_x = g_win32_pos_x;
|
||||||
settings->uints.window_position_y = g_win32_pos_y;
|
settings->uints.window_position_y = g_win32_pos_y;
|
||||||
@ -684,7 +684,6 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
|||||||
*quit = true;
|
*quit = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
win32_save_position();
|
|
||||||
break;
|
break;
|
||||||
case WM_DROPFILES:
|
case WM_DROPFILES:
|
||||||
{
|
{
|
||||||
@ -724,10 +723,9 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message,
|
|||||||
g_win32_resized = true;
|
g_win32_resized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
win32_save_position();
|
|
||||||
*quit = true;
|
*quit = true;
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
if (settings && settings->bools.ui_menubar_enable)
|
if (settings && settings->bools.ui_menubar_enable)
|
||||||
@ -970,7 +968,6 @@ bool win32_window_create(void *data, unsigned style,
|
|||||||
#ifndef _XBOX
|
#ifndef _XBOX
|
||||||
unsigned user_width = width;
|
unsigned user_width = width;
|
||||||
unsigned user_height = height;
|
unsigned user_height = height;
|
||||||
win32_set_position_from_config();
|
|
||||||
|
|
||||||
if (settings->bools.video_window_save_positions
|
if (settings->bools.video_window_save_positions
|
||||||
&& !fullscreen)
|
&& !fullscreen)
|
||||||
|
16
retroarch.c
16
retroarch.c
@ -210,6 +210,7 @@ static bool rarch_is_inited = false;
|
|||||||
static bool rarch_error_on_init = false;
|
static bool rarch_error_on_init = false;
|
||||||
static bool rarch_block_config_read = false;
|
static bool rarch_block_config_read = false;
|
||||||
static bool rarch_force_fullscreen = false;
|
static bool rarch_force_fullscreen = false;
|
||||||
|
static bool rarch_is_switching_display_mode = false;
|
||||||
static bool has_set_verbosity = false;
|
static bool has_set_verbosity = false;
|
||||||
static bool has_set_libretro = false;
|
static bool has_set_libretro = false;
|
||||||
static bool has_set_libretro_directory = false;
|
static bool has_set_libretro_directory = false;
|
||||||
@ -2025,6 +2026,21 @@ void retroarch_unset_forced_fullscreen(void)
|
|||||||
rarch_force_fullscreen = false;
|
rarch_force_fullscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool retroarch_is_switching_display_mode(void)
|
||||||
|
{
|
||||||
|
return rarch_is_switching_display_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void retroarch_set_switching_display_mode(void)
|
||||||
|
{
|
||||||
|
rarch_is_switching_display_mode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void retroarch_unset_switching_display_mode(void)
|
||||||
|
{
|
||||||
|
rarch_is_switching_display_mode = false;
|
||||||
|
}
|
||||||
|
|
||||||
/* set a runtime shader preset without overwriting the settings value */
|
/* set a runtime shader preset without overwriting the settings value */
|
||||||
void retroarch_set_shader_preset(const char* preset)
|
void retroarch_set_shader_preset(const char* preset)
|
||||||
{
|
{
|
||||||
|
@ -330,6 +330,12 @@ void retroarch_unset_shader_preset(void);
|
|||||||
|
|
||||||
char* retroarch_get_shader_preset(void);
|
char* retroarch_get_shader_preset(void);
|
||||||
|
|
||||||
|
bool retroarch_is_switching_display_mode(void);
|
||||||
|
|
||||||
|
void retroarch_set_switching_display_mode(void);
|
||||||
|
|
||||||
|
void retroarch_unset_switching_display_mode(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* retroarch_fail:
|
* retroarch_fail:
|
||||||
* @error_code : Error code.
|
* @error_code : Error code.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user