diff --git a/Common/System/Request.h b/Common/System/Request.h index 75a236cb14..d0e67c78e6 100644 --- a/Common/System/Request.h +++ b/Common/System/Request.h @@ -12,9 +12,11 @@ class Path; typedef std::function RequestCallback; typedef std::function RequestFailedCallback; -// Platforms often have to process requests asynchronously, on wildly different threads. -// (Especially Android...) +// Platforms often have to process requests asynchronously, on wildly different threads, +// and then somehow pass a response back to the main thread (especially Android...) // This acts as bridge and buffer. +// However - the actual request is performed on the current thread, it's the callbacks that are "made threadsafe" +// by running them on the main thread. So beware in your implementations! class RequestManager { public: // These requests are to be handled by platform implementations. diff --git a/Core/Config.cpp b/Core/Config.cpp index 35fc8f210b..79cc767ab3 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -587,12 +587,16 @@ static const ConfigSetting generalSettings[] = { #if defined(USING_WIN_UI) ConfigSetting("TopMost", &g_Config.bTopMost, false), + ConfigSetting("PauseOnLostFocus", &g_Config.bPauseOnLostFocus, false, true, true), +#endif + +#if !defined(MOBILE_DEVICE) ConfigSetting("WindowX", &g_Config.iWindowX, -1), // -1 tells us to center the window. ConfigSetting("WindowY", &g_Config.iWindowY, -1), ConfigSetting("WindowWidth", &g_Config.iWindowWidth, 0), // 0 will be automatically reset later (need to do the AdjustWindowRect dance). ConfigSetting("WindowHeight", &g_Config.iWindowHeight, 0), - ConfigSetting("PauseOnLostFocus", &g_Config.bPauseOnLostFocus, false, true, true), #endif + ConfigSetting("PauseWhenMinimized", &g_Config.bPauseWhenMinimized, false, true, true), ConfigSetting("DumpDecryptedEboots", &g_Config.bDumpDecryptedEboot, false, true, true), ConfigSetting("FullscreenOnDoubleclick", &g_Config.bFullscreenOnDoubleclick, true, false, false), diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index f6eac23799..4fa7c20182 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -794,13 +794,18 @@ int main(int argc, char *argv[]) { int x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(getDisplayNumber()); int y = SDL_WINDOWPOS_UNDEFINED; + if (g_Config.iWindowX != -1) + x = g_Config.iWindowX; + if (g_Config.iWindowY != -1) + y = g_Config.iWindowY; + g_display.pixel_in_dps_x = (float)g_display.pixel_xres / g_display.dp_xres; g_display.pixel_in_dps_y = (float)g_display.pixel_yres / g_display.dp_yres; g_display.dpi_scale_x = g_display.dp_xres / (float)g_display.pixel_xres; g_display.dpi_scale_y = g_display.dp_yres / (float)g_display.pixel_yres; g_display.dpi_scale_real_x = g_display.dpi_scale_x; g_display.dpi_scale_real_y = g_display.dpi_scale_y; - g_display.Print(); + // g_display.Print(); GraphicsContext *graphicsContext = nullptr; SDL_Window *window = nullptr; @@ -960,6 +965,19 @@ int main(int argc, char *argv[]) { break; } + case SDL_WINDOWEVENT_MOVED: + { + int x = event.window.data1; + int y = event.window.data2; + Uint32 window_flags = SDL_GetWindowFlags(window); + bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); + if (!fullscreen) { + g_Config.iWindowX = x; + g_Config.iWindowY = y; + } + break; + } + case SDL_WINDOWEVENT_MINIMIZED: case SDL_WINDOWEVENT_HIDDEN: windowHidden = true;