]> git.sesse.net Git - vlc/commitdiff
macosx: work-around a weird bug which let the drop zone respond to mouseDown events...
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 21 Jun 2012 22:26:23 +0000 (00:26 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 21 Jun 2012 22:28:08 +0000 (00:28 +0200)
Thanks to David for the report

modules/gui/macosx/MainWindowTitle.m

index a7799c4be64015bed37ab5c2deb87fdf5fdf3e52..39b44c9ae1cb4c84e0ad168575473c4d34d14092 100644 (file)
         [o_fullscreen_btn setImage: [NSImage imageNamed:@"window-fullscreen"]];
 }
 
-- (void)mouseUp:(NSEvent *)event
+- (void)mouseDown:(NSEvent *)event
 {
-    if ([event clickCount] == 2) {
+    NSPoint ml = [self convertPoint: [event locationInWindow] fromView: self];
+    if( ([[self window] frame].size.height - ml.y) <= 22. && [event clickCount] == 2) {
         //Get settings from "System Preferences" >  "Appearance" > "Double-click on windows title bar to minimize"
         NSString *const MDAppleMiniaturizeOnDoubleClickKey = @"AppleMiniaturizeOnDoubleClick";
         NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
         if ([[userDefaults objectForKey:MDAppleMiniaturizeOnDoubleClickKey] boolValue])
             [[self window] miniaturize:self];
     }
+
+    [super mouseDown: event];
 }
 @end