1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

iOS: Always assume that your main view is in focus if you are running as an app extension

This commit is contained in:
hogliux 2017-07-10 17:34:16 +01:00
parent 97fdc233e6
commit b1b5c7bf23

View file

@ -216,7 +216,7 @@ public:
UIWindow* window;
JuceUIView* view;
JuceUIViewController* controller;
bool isSharedWindow, fullScreen, insideDrawRect;
bool isSharedWindow, fullScreen, insideDrawRect, isAppex;
static ModifierKeys currentModifiers;
static int64 getMouseTime (UIEvent* e) noexcept
@ -555,7 +555,8 @@ UIViewComponentPeer::UIViewComponentPeer (Component& comp, const int windowStyle
controller (nil),
isSharedWindow (viewToAttachTo != nil),
fullScreen (false),
insideDrawRect (false)
insideDrawRect (false),
isAppex (SystemStats::isRunningInAppExtensionSandbox())
{
CGRect r = convertToCGRect (component.getBounds());
@ -922,6 +923,9 @@ void UIViewComponentPeer::viewFocusLoss()
bool UIViewComponentPeer::isFocused() const
{
if (isAppex)
return true;
return isSharedWindow ? this == currentlyFocusedPeer
: (window != nil && [window isKeyWindow]);
}