Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kivy with SDL2 bootstrap crashes on pausing if app doesn't support pause mode #978

Closed
germn opened this issue Jan 10, 2017 · 8 comments
Closed

Comments

@germn
Copy link
Contributor

germn commented Jan 10, 2017

How to reproduce:

  1. Create app where:
    def on_pause(self):
        return False
  1. Run app
  2. Use "home" button to pause app
  3. App will crush

I used recent kivy/p4a masters. I also used intent_filters option, nothing more specific.
Can anyone confirm it's not only just me?

@KeyWeeUsr
Copy link
Contributor

Does your installation have this line (0db9af7)?

@germn
Copy link
Contributor Author

germn commented Jan 10, 2017

Yes, I used later p4a from 16 december.
Do you have same error? If not, couldn't you tell what ver. of p4a/kivy are you using?

@KeyWeeUsr
Copy link
Contributor

App crashes after calling it back, not when I use home button. Most likely there's missing the same line I linked to somewhere, where p4a handles app that doesn't pause. Probably in the same file.

@germn
Copy link
Contributor Author

germn commented Jan 10, 2017

I got it working. Looks like it's kivy bug, neither then p4a.

ok, in my case back button works fine, here's code where it handles:

if not self.dispatch('on_request_close', source='keyboard'):
    stopTouchApp()
    self.close()
    return True

More interesting about handling on_pause, I found two places with duplicate code (1, 2):

if not app.dispatch('on_pause'):
    Logger.info('WindowSDL: App doesn\'t support pause mode, stop.')
    stopTouchApp()
    return

Only different thing from handling back button is missed calling self.close(). I added this call in both places in window_sdl2.py and now home button works without crash for me.

It doesn't seem like final fix, I'll try to dig deeper later. Probably window_sdl2.py pausing/resuming code need to be refactored (this is also interesting line).

@inclement
Copy link
Member

@germn I didn't know why the crashing was happening, so this is very useful to know, thanks.

@mixmastamyk
Copy link
Contributor

I'm having this problem too, any progress on this bug?

(BTW, the term is crash, haha.)

@germn
Copy link
Contributor Author

germn commented May 17, 2017

@mixmastamyk hello, there is PR that fixes problem:
kivy/kivy#4927

While this PR fixes problem, it's not merged in Kivy yet: there's few things that need to be done before merging in master.

If you want to use PR right now, you'll need to clone Kivy master, merge this branch and use this local cloned Kivy to build app (you can use local Kivy by redefining requirements.source.kivy in buildozer.spec).

@dessant dessant changed the title Kivy with SDL2 bootstrap crushes on pausing if app doesn't support pause mode Kivy with SDL2 bootstrap crashes on pausing if app doesn't support pause mode Oct 7, 2017
@inclement
Copy link
Member

I think this doesn't happen any more with sdl2.0.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants