From 9982fb31ead19730fc004879faf8071c6e80ba5a Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Sun, 24 Dec 2023 10:51:28 +0300 Subject: [PATCH] [macos] fix bug 51040 --- .../Code/Controls/ASCTabs/ASCTabsControl.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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]; }