| Summary: | Android sensorLandscape|sensorPortrait mode and Power Button | ||
|---|---|---|---|
| Product: | SDL | Reporter: | dmuratshin <frankinshtein85> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Android (All) | ||
| Attachments: | fix patch | ||
Hi, can you tell how you use "SENSOR_* mode in AndroidManifest.xml" ? And which device you use. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="......" android:versionCode="9999" android:versionName="0.9.999" android:installLocation="auto"> <application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:allowBackup="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" > <activity android:name="com.alisagaming.slots.MainActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="locale|orientation|keyboardHidden|screenSize" android:screenOrientation="sensorLandscape"> Galaxy S7 Thanks for the fast answer. For the record, the code you modified comes from Bug #2774. Because sometimes the onSurfaceChanged() is called with inversed width/height. and it produced (for me) some screen distortion. I also have a S7, but see no crash. (I tried with no screen lock and with sensor_landscape, I only see a screen glitch) Though, I think your patch is relevant and could be applied ! it is not crashing, application wakeups and works even with turned off display ok, sorry! your patch makes sense anyway! Fixed, thanks! https://hg.libsdl.org/SDL/rev/ba1da2658d76 Just to want to let you know that I have looked again at the issue because I wanted to remove the "skip" portion of java code which seems device-dependant, but I couldn't, this is really needed. Though, I found out a new issue: there is a screen glitch when resuming a landscape application, after un-locking the phone. See bug #3562. Maybe you could test with your android application! Thanks. |
Created attachment 2673 [details] fix patch I attached fix for Android bug could be reproduced if you use SENSER_* mode in AndroidManifest.xml when you press Power Button -> app pauses and then immediately resumes logcat: 01-11 14:25:50.273: V/SDL(18690): onPause() 01-11 14:25:50.273: V/SDL(18690): nativePause() 01-11 14:25:50.863: D/ViewRootImpl(18690): MSG_RESIZED_REPORT: ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 01-11 14:25:50.903: D/mali_winsys(18690): EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000, [1440x2560]-format:1 01-11 14:25:50.933: V/SDL(18690): surfaceChanged() 01-11 14:25:50.933: V/SDL(18690): pixel format RGB_565 01-11 14:25:50.933: V/SDL(18690): Window size: 1440x2560 01-11 14:25:50.943: V/SDL(18690): nativeResume() 01-11 14:25:50.993: V/SDL(18690): onWindowFocusChanged(): false