diff --git a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabsControl.m b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabsControl.m index d00e98844..161977018 100644 --- a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabsControl.m +++ b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabsControl.m @@ -660,6 +660,18 @@ static NSString * const kASCTabsMulticastDelegateKey = @"asctabsmulticastDelegat } } +- (void)otherMouseDown:(NSEvent *)event { +// [super otherMouseDown:event]; + + NSPoint dragPoint = [self.tabsView convertPoint:event.locationInWindow fromView:nil]; + for (ASCTabView * tab in self.tabs) { + if (NSPointInRect(dragPoint, [tab frame])) { + [self tabDidClose: tab]; + break; + } + } +} + - (void)addTab:(ASCTabView *)tab { [self addTab:tab selected:YES]; }