1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

AU Client: Fix calling makeFirstResponder for nil window in Ableton Live

When pressing the Escape key the call to hostView keyDown: closes the
plugin window and the subsequent [hostView window] returns nil.
This commit is contained in:
attila 2025-03-03 19:01:22 +01:00 committed by Attila Szarvas
parent 8c1ff91aa3
commit 4deee6976b

View file

@ -1749,11 +1749,13 @@ public:
auto* view = (NSView*) getWindowHandle();
auto* hostView = [view superview];
auto* hostWindow = [hostView window];
[hostWindow makeFirstResponder: hostView];
[[hostView window] makeFirstResponder: hostView];
[hostView keyDown: currentEvent];
[hostWindow makeFirstResponder: view];
if ((hostView = [view superview]))
if (auto* hostWindow = [hostView window])
[hostWindow makeFirstResponder: view];
}
}
}