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.0 Reported for operating system, platform: Android (All), ARM
Comments on the original bug report:
On 2013-06-06 04:09:19 +0000, wrote:
Created attachment 1176
Fix for display mode updates
*** BEGIN WARNING ***
Before reading this, it worths to warn that the attached patch may break compatibility with a few Android apps. To be more specific I am talking about any app which, for any arbitrary reason, queries the display mode of the desktop/display/window after a resize or restore event arrives.
The reason is that with the given patch, the display mode actually gets updated.
*** END OF WARNING ***
Alright, on to the report itself. At the moment, when a screen rotation occurs, the display mode is not updated anywhere; Not for the window (if there is any), nor for the display.
One side effect of this occurs when the activity resumes. Basically, a SDL_WINDOWEVENT_RESTORED event is added to the queue. The addition of such an event results in an indirect check for any update to the window's dimensions, sending a resize event if necessary.
Problem is it queries a display mode at some point.
The given patch modifies the code so whenever a surface resize is detected (in the Java code), the screen's display mode as updated, along with the window's if there's any. I'm not sure it's the best way to handle that, but at least it seems to fix the issue for me.
On 2013-07-14 04:11:34 +0000, wrote:
I wonder why I didn't think of this or at least comment about that earlier...
Anyway, there is one big problem with the current patch: A case of not being thread safe when updating the display mode (desktop, current and window if there's any).
Maybe the function SDL_SendWindowEvent from SDL_windowevents.c (called by the secondary SDL C thread) should update the window's display mode after a window resize event is sent, although it may seem a bit dangerous at the moment.
Furthermore, maybe the current display mode should be changed here, but not the desktop's.
On 2013-07-14 08:19:46 +0000, wrote:
Of course there are chances that there is no window at all, yet an update to the display mode is still desired.
Due to the thread safety issues I am going to mark the current patch "obsolete", although it should still be available for reference.
On 2017-08-15 18:53:10 +0000, wrote:
Just updating that I think this was resolved, at least after these commits were applied (see also bug 2808):
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Fix for display mode updates (sdl_android_window_rotation_fix.diff, text/plain, 2013-06-06 04:09:19 +0000, 2750 bytes)Reported in version: HG 2.0
Reported for operating system, platform: Android (All), ARM
Comments on the original bug report:
On 2013-06-06 04:09:19 +0000, wrote:
On 2013-07-14 04:11:34 +0000, wrote:
On 2013-07-14 08:19:46 +0000, wrote:
On 2017-08-15 18:53:10 +0000, wrote:
On 2017-08-15 22:59:47 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: