more window vis fixes
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run

This commit is contained in:
Green Sky 2025-01-10 18:12:08 +01:00
parent a417f9059e
commit 859ad7df81
No known key found for this signature in database

View File

@ -266,7 +266,7 @@ bool MainScreen::handleEvent(SDL_Event& e) {
if (_window_hidden_ts < e.window.timestamp) {
_window_hidden_ts = e.window.timestamp;
_window_hidden = true;
//std::cout << "TOMAT: window hidden " << e.window.timestamp << "\n";
//std::cout << "TOMAT: window hidden " << e.type << " " << e.window.timestamp << "\n";
}
}
return true; // forward?
@ -274,7 +274,7 @@ bool MainScreen::handleEvent(SDL_Event& e) {
if (
e.type == SDL_EVENT_WINDOW_SHOWN ||
e.type == SDL_EVENT_WINDOW_RESTORED ||
//e.type == SDL_EVENT_WINDOW_RESTORED || // triggers on hide
e.type == SDL_EVENT_WINDOW_EXPOSED
) {
auto* window = SDL_GetWindowFromID(e.window.windowID);
@ -283,13 +283,15 @@ bool MainScreen::handleEvent(SDL_Event& e) {
if (_window_hidden_ts <= e.window.timestamp) {
_window_hidden_ts = e.window.timestamp;
#if 0
if (_window_hidden) {
// if window was previously hidden, we shorten the wait for the next frame
_render_interval = 1.f/60.f;
}
#endif
_window_hidden = false;
//std::cout << "TOMAT: window shown " << e.window.timestamp << "\n";
//std::cout << "TOMAT: window shown " << e.type << " " << e.window.timestamp << "\n";
}
}
_render_interval = 1.f/60.f; // TODO: magic