From c79c794a00e418590665cf7c2aa7309669b6a43d Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 25 Sep 2024 16:31:33 +0300 Subject: [PATCH] [macos] fix bug 69526 --- .../Controllers/Common/ASCCommonViewController.mm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm index b8cd686a4..974140cd3 100644 --- a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm +++ b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm @@ -442,7 +442,9 @@ [[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameFullscreen object:nil - userInfo:@{@"fullscreen" : @(NO)}]; + userInfo:@{@"fullscreen" : @(NO), + @"terminate" : @(YES) + }]; for (ASCTabView * tab in self.tabsControl.tabs) { if (tab.changed) { @@ -881,8 +883,13 @@ NSDictionary * params = (NSDictionary *)notification.userInfo; BOOL isFullscreen = [params[@"fullscreen"] boolValue]; - int viewId = [params[@"viewId"] intValue]; - ASCTabView * tab = [self tabViewWithId:viewId]; + ASCTabView * tab= nil; + if ( [params objectForKey:@"viewId"] ) { + tab = [self tabViewWithId:[params[@"viewId"] intValue]]; + } else if ( [params objectForKey:@"terminate"] and [params[@"terminate"] boolValue] ) { + if (self.tabsControl.tabs.count > 0) + tab = [self.tabsControl selectedTab]; + } if ( tab ) { NSTabViewItem * item = [self.tabView tabViewItemAtIndex:[self.tabView indexOfTabViewItemWithIdentifier:tab.uuid]];