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

Lockwindow got wrong size make my app lockScreen UI abnormal #1492

Closed
84798012 opened this issue Dec 6, 2019 · 9 comments
Closed

Lockwindow got wrong size make my app lockScreen UI abnormal #1492

84798012 opened this issue Dec 6, 2019 · 9 comments
Assignees
Labels
bug A defect in the library

Comments

@84798012
Copy link

84798012 commented Dec 6, 2019

Bug Report

[Summary]
When car in moving mode, my app lock screen UI shows the lockScreen image on top left corner.
But when using SDL v6.3.1, no this issue.

The root cause may as below. If I remove the code like below, sometimes can work well, sometimes not work. If recover those code, lockScreen UI always not work.

@implementation SDLLockScreenViewController

//- (BOOL)shouldAutorotate {
// if (self.presentingViewController != nil) {
// return self.presentingViewController.shouldAutorotate;
// } else {
// return YES;
// }
//}
//
//- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
// if (self.presentingViewController != nil) {
// return self.presentingViewController.supportedInterfaceOrientations;
// } else {
// return UIInterfaceOrientationMaskAll;
// }
//}

OS & Version Information
  • iOS Version: [What version of iOS are you using when the bug occurred]
    13.1.3
  • SDL iOS Version: [What version of the library has this bug been seen on]
    6.4.1

Here is the issue's screenshot link:
https://github.com/84798012/SDL_Window_Rotate_Bug_Reproduce_Demo/blob/master/WechatIMG1.jpeg

@joeljfischer
Copy link
Contributor

Hi @84798012, unfortunately, it's difficult to tell what is happening in this issue. Could you do something similar with reproduction steps on the example app, and/or an example app like you did for the previous issue?

We cannot remove the code you mentioned or else rotation won't work correctly for some apps. It seems like you're using a custom lock screen, so it may be an issue with your constraints?

@84798012
Copy link
Author

I made a demo to reproduce this issue, please check below link:
https://github.com/84798012/SDL_Window_Rotate_Bug_Reproduce_Demo/tree/master/lockScreenIssue

@justingluck93
Copy link
Contributor

@84798012 Can you please test using this PR #1499

@84798012 84798012 changed the title SDLLockScreenViewController wrong rotation make my app lockScreen UI abnormal Lockwindow got wrong size make my app lockScreen UI abnormal Dec 11, 2019
@84798012
Copy link
Author

84798012 commented Dec 11, 2019

Thanks.
The lockwindow size seems been fixed.
But another issue appears. when the lockwindow dissmissed, appwindow(should not show) is wrongly be makekeywindow. Do I need report new bug to fix or just continue on this bug?
if you want to reproduce, just modify the demo code I have post like below:
//testWindow = [[UIWindow alloc] initWithFrame:CGRectZero];
testWindow = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
if you can not reproduce, just let me know, I will make new one.

And what I suggest is that : in SDL to get app window and operate it is dangerous, it may cause potential issue.

// dangerous
for (UIWindow *window in windows) {
if (window != self.lockWindow) {
SDLLogV(@"Found app window");
appWindow = window;
break;
}
}
// dangerous
sdl_dismissWithAppWindow:(nullable UIWindow *)appWindow {
appWindow.frame = self.lockWindow.bounds;
[appWindow makeKeyAndVisible];
}

@joeljfischer
Copy link
Contributor

And what I suggest is that : in SDL to get app window and operate it is dangerous, it may cause potential issue.

@84798012 Unfortunately, because we have to make the lockWindow the keyWindow, when we dismiss it, we have to make another window the new keyWindow.

@84798012
Copy link
Author

84798012 commented Dec 11, 2019

@joeljfischer , ok, Thanks for your reply.
Then this lockscreen wrong issue seems been fixed.
I have to report new bug for dissmiss lockwindow case, that will block our app, SDL just random select a appwindow(it may be our securewindow, should not show) to show make our app can do nothing. I don't think its resonable.
here is the new issue link:
#1501

@84798012
Copy link
Author

fixed, so close it.

@joeljfischer
Copy link
Contributor

@84798012 Could you please re-test this bug using PR #1509? We ended up doing a large refactor of the lock screen code and would like to confirm that it still fixes all of your issues. Thank you!

@84798012
Copy link
Author

I have test on 1509, the issue fixed. Thanks!

@joeljfischer joeljfischer mentioned this issue Jan 7, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

No branches or pull requests

3 participants