macOS: Fix keyboard input not working after toggling full screen

This commit is contained in:
pagedown 2021-12-12 23:25:53 +08:00
parent 2c13005e0f
commit d0fa0516f5
No known key found for this signature in database
GPG key ID: E921CF18AC8FF6EB

View file

@ -1644,6 +1644,9 @@ - (void)toggleFullScreen:(nullable id)sender
[self setResizeIncrements:NSMakeSize(1.0, 1.0)];
[super toggleFullScreen:sender];
[self setResizeIncrements:original];
// When the window decoration is hidden, toggling fullscreen causes the style mask to be changed,
// and causes the first responder to be cleared.
if (glfw_window && !glfw_window->decorated && glfw_window->ns.view) [self makeFirstResponder:glfw_window->ns.view];
}
@end