| Summary: | iOS: UIAlerController Text not getting focus | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Dominik Reichardt <sdl-bugzilla> |
| Component: | events | Assignee: | Alex Szpakowski <amaranth72> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
|
Description
Dominik Reichardt
2019-06-08 19:34:25 UTC
Alex, can you take a look at this? Thanks! Curiosly this is working correctly with the beta of the iOS 13 SDK. Changing the way Exult displays the UIAlertControl fixed it on my end. https://github.com/litchie/exult-ios/commit/bc4f1c6a36304b1ba73bf5e763bdbee337d73008 So, for some reason this worked before these changesets and works in the iOS 13 SDK beta, but after all, I think I just created the alertcontrol wrong and was just lucky before. What is your opinion Alex? I've tried to reproduce this locally by modifying SDL's implementation of ShowMessageBox to add a text field (it will use the parent window if you pass one in to the high level API call, otherwise it will use a dedicated UIWindow like your workaround), but so far it's been working fine for me in both scenarios - I haven't been able to reproduce the problem at all. I'm testing with SDL's testmessage code plus that change, on an iOS 12.2 Simulator as well as on my iPhone running iOS 12.3. Ah, I lied... I can seem to reproduce it, I was just stopping before it showed the message box which used a parent window. My bad :) For now I've removed that didAddSubview override code, doing so fixed it for me: https://hg.libsdl.org/SDL/rev/afe3c46cc37e I don't understand how that didAddSubview code was supposed to work, and more importantly I don't understand what problem it was supposed to solve exactly. Touch and simulated mouse events and their reported coordinates still work perfectly for me after removing it (tested with some SDL_Render-based code which uses SDL's Metal rendering backend for drawing). @Sam, is there something that needs to be fixed in a different way after removing the above code? The comment in that code talks about Metal views not responding to touches, but SDL-created Metal views inherit from SDL_uikitview which handles touch events. If the comment is talking about some custom view added by a user, I believe they can pass through touch event handling to SDL's own view. I also have a patch floating around to allow users to create SDL's metal views directly via new APIs. Or if none of those options are applicable maybe we can move the touch event handling code to the view controller instead of the view? Thanks for fixing this and confirming that I didn't mess up after all. I just am without my mac for a week so I cannot test it on my end! Sam's code did fix other problems I and others had with touch not working in our app. See https://discourse.libsdl.org/t/touch-mouse-broken-on-ios/26139/2 Interesting. Touch is working 100% fine for me in my tests. Was there ever a repro project for touch breaking? I wonder what the important difference is between my test projects and apps where it breaks, assuming it's not been fixed by some other change in between then and now. Too bad I can't test right now but you can test with Exult for iOS https://github.com/litchie/exult-ios (xcode project file is in the iOS subfolder and in there you need to replace the contents of the SDL2 folder with SDL2 hg). Even though to play the Ultima VII you need the game files, it's enough to test wether touch is now working. The start screen will tell you that you need the game files but a touch should launch safari with our documentation. This did not work without Sam's changeset. I ran it with the latest SDL code from hg, and tapping the screen opened the sourceforge page in Safari for me. Hmm, something else fixed it then, I guess ;) I haven't looked at the codebase at all yet, but is it possible it only breaks at some point after the initial screen, when the game's assets are loaded properly (due to a different UIWindow configuration or something)? I think this fixed it, thanks! https://hg.libsdl.org/SDL/rev/cbd7a9f0a05e Whoops, never mind... Alex, that comment might be related to a custom Metal view. I'll find out. Returned and got hg and everything works for me. Issue is resolved on my end. Thanks for looking Excellent. Thanks for testing! Btw, I just did a bisect and indeed Sam's changes in https://hg.libsdl.org/SDL/rev/cbd7a9f0a05e were fixing the touch issue without breaking the UIAlertController Text. |