[vlc-commits] macosx: work-around a weird bug which let the drop zone respond to mouseDown events targetted at the window title

Felix Paul Kühne git at videolan.org
Fri Jun 22 00:28:13 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jun 22 00:26:23 2012 +0200| [bbb30ce0e0b9ff526865ec126f370056bbf8735e] | committer: Felix Paul Kühne

macosx: work-around a weird bug which let the drop zone respond to mouseDown events targetted at the window title

Thanks to David for the report

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bbb30ce0e0b9ff526865ec126f370056bbf8735e
---

 modules/gui/macosx/MainWindowTitle.m |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/MainWindowTitle.m b/modules/gui/macosx/MainWindowTitle.m
index a7799c4..39b44c9 100644
--- a/modules/gui/macosx/MainWindowTitle.m
+++ b/modules/gui/macosx/MainWindowTitle.m
@@ -242,9 +242,10 @@
         [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];
@@ -253,6 +254,8 @@
         if ([[userDefaults objectForKey:MDAppleMiniaturizeOnDoubleClickKey] boolValue])
             [[self window] miniaturize:self];
     }
+
+    [super mouseDown: event];
 }
 @end
 



More information about the vlc-commits mailing list