From 5e066670d0633f94e8e02b6e417e262b759863d9 Mon Sep 17 00:00:00 2001 From: Akemi Date: Mon, 13 Mar 2017 18:07:22 +0100 Subject: cocoa: fix first responder when borderless window is used this fixes a weird behaviour when a borderless window's style mask is set to a none-borderless style mask. this can happen when cycling the border or just toggling fullscreen. what happens is that the first responder is reset to the NSWindow instead of being kept, the events view in our case. this happens without the usual resignFirstResponder, becomeFirstResponder routine. this is a small workaround that overrides the setStyleMask method. it keeps the first responder from before the style mask change and resets this first responder after the new style mask was applied. --- video/out/cocoa/window.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'video') diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m index 137ef530d9..d26d7272a6 100644 --- a/video/out/cocoa/window.m +++ b/video/out/cocoa/window.m @@ -70,6 +70,13 @@ return self; } +- (void)setStyleMask:(NSWindowStyleMask)style +{ + NSResponder *nR = [self firstResponder]; + [super setStyleMask:style]; + [self makeFirstResponder:nR]; +} + - (void)toggleFullScreen:(id)sender { if (_is_animating) -- cgit v1.2.3