mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 15:15:37 +00:00
(Unix) Changed the fullscreen mode to SDL_WINDOW_FULLSCREEN_DESKTOP.
Also removed the --windowed, --fullscreen-normal and --fullscreen-borderless command line options and menu entry.
This commit is contained in:
parent
50a8edecf3
commit
515577c8f9
|
@ -878,25 +878,6 @@ void GuiMenu::openOtherOptions()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
#if defined(__unix__)
|
|
||||||
// Fullscreen mode.
|
|
||||||
auto fullscreen_mode = std::make_shared<OptionListComponent<std::string>>(
|
|
||||||
mWindow, getHelpStyle(), "FULLSCREEN MODE", false);
|
|
||||||
std::vector<std::string> screenmode;
|
|
||||||
screenmode.push_back("normal");
|
|
||||||
screenmode.push_back("borderless");
|
|
||||||
for (auto it = screenmode.cbegin(); it != screenmode.cend(); ++it)
|
|
||||||
fullscreen_mode->add(*it, *it, Settings::getInstance()->getString("FullscreenMode") == *it);
|
|
||||||
s->addWithLabel("FULLSCREEN MODE (REQUIRES RESTART)", fullscreen_mode);
|
|
||||||
s->addSaveFunc([fullscreen_mode, s] {
|
|
||||||
if (fullscreen_mode->getSelected() !=
|
|
||||||
Settings::getInstance()->getString("FullscreenMode")) {
|
|
||||||
Settings::getInstance()->setString("FullscreenMode", fullscreen_mode->getSelected());
|
|
||||||
s->setNeedsSaving();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BUILD_VLC_PLAYER)
|
#if defined(BUILD_VLC_PLAYER)
|
||||||
// Video player.
|
// Video player.
|
||||||
auto video_player = std::make_shared<OptionListComponent<std::string>>(
|
auto video_player = std::make_shared<OptionListComponent<std::string>>(
|
||||||
|
|
|
@ -273,22 +273,6 @@ bool parseArgs(int argc, char* argv[])
|
||||||
Settings::getInstance()->setInt("ScreenRotate", rotate);
|
Settings::getInstance()->setInt("ScreenRotate", rotate);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
// On Unix, enable settings for the fullscreen mode.
|
|
||||||
// On macOS and Windows only windowed mode is supported.
|
|
||||||
|
|
||||||
#if defined(__unix__)
|
|
||||||
else if (strcmp(argv[i], "--windowed") == 0) {
|
|
||||||
Settings::getInstance()->setBool("Windowed", true);
|
|
||||||
}
|
|
||||||
else if (strcmp(argv[i], "--fullscreen-normal") == 0) {
|
|
||||||
Settings::getInstance()->setString("FullscreenMode", "normal");
|
|
||||||
settingsNeedSaving = true;
|
|
||||||
}
|
|
||||||
else if (strcmp(argv[i], "--fullscreen-borderless") == 0) {
|
|
||||||
Settings::getInstance()->setString("FullscreenMode", "borderless");
|
|
||||||
settingsNeedSaving = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (strcmp(argv[i], "--vsync") == 0) {
|
else if (strcmp(argv[i], "--vsync") == 0) {
|
||||||
if (i >= argc - 1) {
|
if (i >= argc - 1) {
|
||||||
std::cerr << "Error: No VSync value supplied.\n";
|
std::cerr << "Error: No VSync value supplied.\n";
|
||||||
|
@ -360,11 +344,6 @@ bool parseArgs(int argc, char* argv[])
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" --display [index 1-4] Display/monitor to use\n"
|
" --display [index 1-4] Display/monitor to use\n"
|
||||||
" --resolution [width] [height] Application resolution\n"
|
" --resolution [width] [height] Application resolution\n"
|
||||||
#if defined(__unix__)
|
|
||||||
" --windowed Windowed mode, should be combined with --resolution\n"
|
|
||||||
" --fullscreen-normal Normal fullscreen mode\n"
|
|
||||||
" --fullscreen-borderless Borderless fullscreen mode (always on top)\n"
|
|
||||||
#endif
|
|
||||||
" --vsync [1/on or 0/off] Turn VSync on or off (default is on)\n"
|
" --vsync [1/on or 0/off] Turn VSync on or off (default is on)\n"
|
||||||
" --max-vram [size] Max VRAM to use (in mebibytes) before swapping\n"
|
" --max-vram [size] Max VRAM to use (in mebibytes) before swapping\n"
|
||||||
" --no-splash Don't show the splash screen during startup\n"
|
" --no-splash Don't show the splash screen during startup\n"
|
||||||
|
|
|
@ -102,7 +102,7 @@ int launchGameUnix(const std::string& cmd_utf8, bool runInBackground)
|
||||||
|
|
||||||
#if defined(_RPI_)
|
#if defined(_RPI_)
|
||||||
// Hack to avoid that the application window occasionally loses focus when returning from
|
// Hack to avoid that the application window occasionally loses focus when returning from
|
||||||
// a game, which only seems to happen on the Raspberry Pi.
|
// a game, which only seems to happen on Raspberry Pi OS 10.
|
||||||
SDL_Delay(50);
|
SDL_Delay(50);
|
||||||
SDL_SetWindowInputFocus(Renderer::getSDLWindow());
|
SDL_SetWindowInputFocus(Renderer::getSDLWindow());
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,8 +25,7 @@ namespace
|
||||||
// the in-program settings menu. Most can be set using command-line arguments,
|
// the in-program settings menu. Most can be set using command-line arguments,
|
||||||
// but some are debug flags that are either hardcoded or set by internal debug
|
// but some are debug flags that are either hardcoded or set by internal debug
|
||||||
// functions.
|
// functions.
|
||||||
std::vector<std::string> settingsSkipSaving
|
std::vector<std::string> settingsSkipSaving{
|
||||||
{
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// These options can be set using command-line arguments:
|
// These options can be set using command-line arguments:
|
||||||
"WindowWidth", // Set via --resolution [width] [height]
|
"WindowWidth", // Set via --resolution [width] [height]
|
||||||
|
@ -35,9 +34,6 @@ namespace
|
||||||
"IgnoreGamelist", // --ignore-gamelist
|
"IgnoreGamelist", // --ignore-gamelist
|
||||||
"SplashScreen", // --no-splash
|
"SplashScreen", // --no-splash
|
||||||
"Debug", // --debug
|
"Debug", // --debug
|
||||||
#if !defined(_WIN64)
|
|
||||||
"Windowed", // --windowed
|
|
||||||
#endif
|
|
||||||
"VSync", // --vsync [1/on or 0/off]
|
"VSync", // --vsync [1/on or 0/off]
|
||||||
"ForceFull", // --force-full
|
"ForceFull", // --force-full
|
||||||
"ForceKiosk", // --force-kiosk
|
"ForceKiosk", // --force-kiosk
|
||||||
|
@ -225,9 +221,6 @@ void Settings::setDefaults()
|
||||||
mIntMap["MaxVRAM"] = {256, 256};
|
mIntMap["MaxVRAM"] = {256, 256};
|
||||||
#endif
|
#endif
|
||||||
mIntMap["DisplayIndex"] = {1, 1};
|
mIntMap["DisplayIndex"] = {1, 1};
|
||||||
#if defined(__unix__)
|
|
||||||
mStringMap["FullscreenMode"] = {"normal", "normal"};
|
|
||||||
#endif
|
|
||||||
#if defined(BUILD_VLC_PLAYER)
|
#if defined(BUILD_VLC_PLAYER)
|
||||||
mStringMap["VideoPlayer"] = {"ffmpeg", "ffmpeg"};
|
mStringMap["VideoPlayer"] = {"ffmpeg", "ffmpeg"};
|
||||||
#endif
|
#endif
|
||||||
|
@ -275,9 +268,6 @@ void Settings::setDefaults()
|
||||||
mBoolMap["IgnoreGamelist"] = {false, false};
|
mBoolMap["IgnoreGamelist"] = {false, false};
|
||||||
mBoolMap["SplashScreen"] = {true, true};
|
mBoolMap["SplashScreen"] = {true, true};
|
||||||
mBoolMap["VSync"] = {true, true};
|
mBoolMap["VSync"] = {true, true};
|
||||||
#if !defined(_WIN64)
|
|
||||||
mBoolMap["Windowed"] = {false, false};
|
|
||||||
#endif
|
|
||||||
mIntMap["WindowWidth"] = {0, 0};
|
mIntMap["WindowWidth"] = {0, 0};
|
||||||
mIntMap["WindowHeight"] = {0, 0};
|
mIntMap["WindowHeight"] = {0, 0};
|
||||||
mIntMap["ScreenWidth"] = {0, 0};
|
mIntMap["ScreenWidth"] = {0, 0};
|
||||||
|
|
|
@ -172,23 +172,19 @@ namespace Renderer
|
||||||
setupWindow();
|
setupWindow();
|
||||||
|
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
// For Windows, always set the mode to windowed, as full screen mode seems to
|
// For Windows, always set the mode to windowed as full screen mode seems to behave quite
|
||||||
// behave quite erratic. There may be a proper fix for this, but for now windowed
|
// erratic. There may be a proper fix for this, but for now windowed mode seems to behave
|
||||||
// mode seems to behave well and it's almost completely seamless, especially with
|
// well and it's almost completely seamless, especially with a hidden taskbar.
|
||||||
// a hidden taskbar. As well, setting SDL_WINDOW_BORDERLESS introduces issues too
|
|
||||||
// so unfortunately this needs to be avoided.
|
|
||||||
windowFlags = getWindowFlags();
|
windowFlags = getWindowFlags();
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
// This seems to be the only full window mode that somehow works on macOS as a real
|
// The SDL_WINDOW_BORDERLESS mode seems to be the only mode that somehow works on macOS
|
||||||
// fullscreen mode will do lots of weird stuff like preventing window switching
|
// as a real fullscreen mode will do lots of weird stuff like preventing window switching
|
||||||
// or refusing to let emulators run at all. SDL_WINDOW_FULLSCREEN_DESKTOP almost
|
// or refusing to let emulators run at all. SDL_WINDOW_FULLSCREEN_DESKTOP almost works, but
|
||||||
// works, but it "shuffles" windows when starting the emulator and won't return
|
// it "shuffles" windows when starting the emulator and won't return properly when the game
|
||||||
// properly when the game has exited. With the current mode, the top menu is visible
|
// has exited. With SDL_WINDOW_BORDERLESS, the splash screen is not displayed until the
|
||||||
// and hides that part of the ES window. Also, the splash screen is not displayed
|
// point where ES-DE has almost completely finished loading. As well the emulator has to be
|
||||||
// until the point where ES has almost completely finished loading. I'm not sure
|
// configured to run in fullscreen mode or switching to its windows will not work when a
|
||||||
// if anything can be done to improve these things as it's quite obvious that
|
// game is launched. So there is room for improvement although it's acceptable for now.
|
||||||
// Apple has shipped a broken and/or dysfunctional window manager with their
|
|
||||||
// operating system.
|
|
||||||
if (!userResolution)
|
if (!userResolution)
|
||||||
windowFlags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI | getWindowFlags();
|
windowFlags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALLOW_HIGHDPI | getWindowFlags();
|
||||||
else
|
else
|
||||||
|
@ -196,20 +192,10 @@ namespace Renderer
|
||||||
// border to the window.
|
// border to the window.
|
||||||
windowFlags = SDL_WINDOW_ALLOW_HIGHDPI | getWindowFlags();
|
windowFlags = SDL_WINDOW_ALLOW_HIGHDPI | getWindowFlags();
|
||||||
#else
|
#else
|
||||||
if (Settings::getInstance()->getBool("Windowed")) {
|
if (!userResolution)
|
||||||
|
windowFlags = SDL_WINDOW_FULLSCREEN_DESKTOP | getWindowFlags();
|
||||||
|
else
|
||||||
windowFlags = getWindowFlags();
|
windowFlags = getWindowFlags();
|
||||||
}
|
|
||||||
else if (Settings::getInstance()->getString("FullscreenMode") == "borderless") {
|
|
||||||
if (!userResolution)
|
|
||||||
windowFlags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_ALWAYS_ON_TOP | getWindowFlags();
|
|
||||||
else
|
|
||||||
// If the user has changed the resolution from the command line, then add a
|
|
||||||
// border to the window and don't make it stay on top.
|
|
||||||
windowFlags = getWindowFlags();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
windowFlags = SDL_WINDOW_FULLSCREEN | getWindowFlags();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((sdlWindow =
|
if ((sdlWindow =
|
||||||
|
|
Loading…
Reference in a new issue