Closed ghost closed 6 years ago
Interestingly, kivy doesn't seem to have special handling for SDL_QUIT
that somehow works around this: https://github.com/kivy/kivy/blob/96dfa5b55ed74c8223152dd84cd478bfed03e90b/kivy/core/window/_window_sdl2.pyx#L521
Am I doing something unusual again that could cause this? Do all kivy apps just terminate on screen rotation? :confused: Weird
-- snip - what i wrote here may have been just confusion on my side, I'm still investigating --
closing since I finally managed to debug p4a to find out what the issue is
I am using PySDL2 + python-for-android without kivy. In my test app, the first orientation change seems to cause an
SDL_QUIT
and anSDL_APP_TERMINATING
event, and I don't know why - it looks like a bug to me.This is the test code (feel free to build & test for yourself, needs
--requirements=sdl2,pysdl2,python3crystax
,--orientation user
of course, and possibly--window
to reproduce):This is the output:
All I did during this output was 1. launch the app, 2. change screen orientation. This is the output indicating the bug:
This simply shouldn't happen, I think. I'm not sure why it does. When I change the code to not ignore those bogus events and actually terminate, the app crashes on orientation change with some java wrapper backtrace that looks like it's confused why the SDL window is suddenly gone. (well, why did it send me
SDL_QUIT
andSDL_APP_TERMINATING
then...?)Also, even more strangely, for any later orientation changes, this no longer happens. The bogus events only get sent for the very first one right after the app launched into my
main.py
code.Steps to reproduce:
--requirements=python3crystax,pysdl2,sdl2 --orientation user --window
(last flag may or may not be required to reproduce)adb logcat
confirmed the app launch with the lineCreating window (app launch)...
, rotate your phone