From 50cadb87e8f7f8a9e064c86753f348a1e0f9c485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 16 Oct 2014 15:37:48 +0200 Subject: iOS: Detect window deactivation without waiting for next runloop iteration Since we know and control whether or not we are making a new QUIView first responder, we can take not of this at that point, and use that information when another view is resigning first responder. Change-Id: I508720d418c92dc8a8011b489cc5cace8fc82633 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosglobal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/platforms/ios/qiosglobal.h') diff --git a/src/plugins/platforms/ios/qiosglobal.h b/src/plugins/platforms/ios/qiosglobal.h index fccb051645..dbedba7e85 100644 --- a/src/plugins/platforms/ios/qiosglobal.h +++ b/src/plugins/platforms/ios/qiosglobal.h @@ -71,4 +71,14 @@ QT_END_NAMESPACE +(id)currentFirstResponder; @end +class FirstResponderCandidate : public QScopedValueRollback +{ +public: + FirstResponderCandidate(UIResponder *); + static UIResponder *currentCandidate() { return s_firstResponderCandidate; } + +private: + static UIResponder *s_firstResponderCandidate; +}; + #endif // QIOSGLOBAL_H -- cgit v1.2.3