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

fix black screen when return from background #1918

Merged

Conversation

@minggo
Copy link
Contributor

minggo commented Nov 1, 2019

This issue happend by on some iOS devices with iOS13 by doing these operations:

  • lock the screen when the application is running
  • unlock the screen and return to the application
This issue happend by on some iOS devices with iOS13 by doing these operations:
- lock the screen when the application is running
- unlock the screen and return to the application
@holycanvas holycanvas merged commit daa0c54 into cocos-creator:v2.2.1-release Nov 1, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
// will return false if lock screen when running application, which make framebuffer in invalid state.
// FIXME: do binding framebuffer in other place?
UIApplicationState state = [[UIApplication sharedApplication] applicationState];
if (state == UIApplicationStateBackground)

This comment has been minimized.

Copy link
@dumganhar

dumganhar Nov 15, 2019

Contributor

这里是不是应该判断 state != UIApplicationStateActive 比较合适?因为 Inactive 和 background 的时候都不能调用 GL 函数的。
WeChatecb53846cb9798dc5f8ee790ff239324

This comment has been minimized.

Copy link
@minggo

minggo Nov 15, 2019

Author Contributor

应该也可以。目前的实现会出现什么问题吗?

This comment has been minimized.

Copy link
@dumganhar

dumganhar Nov 16, 2019

Contributor

进游戏,马上最小化,好像还是会黑屏呢。

This comment has been minimized.

Copy link
@minggo

minggo Nov 18, 2019

Author Contributor

我测试过,没问题啊。

@lanxuaner

This comment has been minimized.

Copy link

lanxuaner commented Jan 2, 2020

引擎版本:2.2.1
微信版本:7.0.9
ios系统版本:13.3
锁屏后,仍然会卡屏,大概8s之后,就自动恢复,。大大们,可以关注下这个问题吗?

@minggo

This comment has been minimized.

Copy link
Contributor Author

minggo commented Jan 3, 2020

你说的是微信小游戏运行的问题?如果是的话,那这个 PR 不是解决这个问题的。这个 PR 解决的是Creator 发布为 iOS 原生游戏的问题。

@lanxuaner

This comment has been minimized.

Copy link

lanxuaner commented Jan 4, 2020

哦哦,好的,那ios13上微信小游戏卡屏的问题你们能解决吗?

@minggo

This comment has been minimized.

Copy link
Contributor Author

minggo commented Jan 4, 2020

这个能麻烦在论坛建立帖子详细描述一下吗?我让同事看一下。

@lanxuaner

This comment has been minimized.

Copy link

lanxuaner commented Jan 4, 2020

可以的,我正在建立一个空的工程测试看看,然后发个帖子。

@minggo minggo deleted the minggo:ios-back-screen-v2.2.1 branch Jan 13, 2020
@lzwasyc

This comment has been minimized.

Copy link

lzwasyc commented Jan 13, 2020

我测试的是2.2.2 版本也有这个问题,微信小游戏在ios13上,有时是卡8s有时是直接把微信给干退了。微信都闪退了。十分影响用户体验,求解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.