[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:45 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jun 22 00:26:23 2012 +0200| [268359b7dae3e6d83a4e35c812ac2cb6536e0138] | 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
(cherry picked from commit bbb30ce0e0b9ff526865ec126f370056bbf8735e)

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

 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 0c9091e..7de275d 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