You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.1 Reported for operating system, platform: Android (All), All
Comments on the original bug report:
On 2014-12-07 01:47:26 +0000, Jonas Kulla wrote:
Created attachment 1960
proposed patch
At startup time, the single android window is assigned a "windowed" (window->windowed.{w,h}) size based on the current orientation of the mobile device; this size is never updated throughout the lifetime of the app.
This becomes problematic when the app is paused and then resumed in an orientation that it did not start up in. Eventually, 'SDL_OnWindowRestored()' is called, which calls 'SDL_UpdateFullscreenMode()'. This function is very problematic because it is written with a desktop monitor in mind: it tries to find a matching display mode for the windowed size, doesn't find any, and finally applies the windowed size as the fullscreen one. In the end, the windowed size is reported in a RESIZED event, which doesn't correspond to the actual surface size.
To see this in action: Start an orientation aware SDL app in eg. portrait mode, suspend the app, put the device into landscape orientation and resume the app. It will erroneously render in portrait mode (until the device is rotated again).
My first attempt at fixing this involved updating Android_Window->windowed inside 'Android_SetScreenResolution()', but that would mean writing fields from the Java thread that could potentially be read from by the native thread at the same time. A very low chance, but nevertheless.
Instead, I just completely disabled 'SDL_UpdateFullscreenMode()' for Android as tbh. this function makes absolutely no sense in the context of mobile screens. An even cleaner solution would be to introduce a third FULLSCREEN_* flag that indicates "don't mess with the current size in any way".
On 2015-02-19 04:21:27 +0000, Ryan C. Gordon wrote:
Tossing this bug to Gabriel for review.
--ryan.
On 2015-02-19 05:22:21 +0000, Ryan C. Gordon wrote:
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
On 2015-09-13 15:49:09 +0000, matt wrote:
Created attachment 2264
alternative workaround
I ran into this recently, worked around it by always forcing the current mode to match the resized screen resolution (patch attached).
On 2015-09-14 03:30:16 +0000, Alex Szpakowski wrote:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.1
Reported for operating system, platform: Android (All), All
Comments on the original bug report:
On 2014-12-07 01:47:26 +0000, Jonas Kulla wrote:
On 2015-02-19 04:21:27 +0000, Ryan C. Gordon wrote:
On 2015-02-19 05:22:21 +0000, Ryan C. Gordon wrote:
On 2015-09-13 15:49:09 +0000, matt wrote:
On 2015-09-14 03:30:16 +0000, Alex Szpakowski wrote:
On 2016-10-07 22:21:39 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: