[vlc-commits] windowed mac plugin: make sure that the toolbar responds to mouse events in fullscreen mode

Felix Paul Kühne git at videolan.org
Wed Jan 16 14:53:13 CET 2013


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 16 14:53:04 2013 +0100| [e1176ec7a1194be2f63eaa454a36eef582a7624e] | committer: Felix Paul Kühne

windowed mac plugin: make sure that the toolbar responds to mouse events in fullscreen mode

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

 npapi/vlcplugin_mac.mm |   32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index 01976a8..d24c1e3 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -951,12 +951,42 @@ static CGImageRef createImageNamed(NSString *name)
 - (void)mouseDown:(NSEvent *)theEvent
 {
     if ([theEvent type] == NSLeftMouseDown && !([theEvent modifierFlags] & NSControlKeyMask)) {
-        if ([theEvent clickCount] > 1)
+        if ([theEvent clickCount] >= 2)
             self.cppPlugin->toggle_fullscreen();
+        else {
+            NSPoint point = [NSEvent mouseLocation];
+
+            [controllerLayer handleMouseDown:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+        }
     }
 
     [super mouseDown: theEvent];
 }
 
+- (void)mouseUp:(NSEvent *)theEvent
+{
+    NSPoint point = [NSEvent mouseLocation];
+
+    [controllerLayer handleMouseUp:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+
+    [super mouseUp: theEvent];
+}
+
+- (void)mouseDragged:(NSEvent *)theEvent
+{
+    NSPoint point = [NSEvent mouseLocation];
+
+    [controllerLayer handleMouseDragged:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+
+    [super mouseDragged: theEvent];
+}
+
+- (void)mouseMoved:(NSEvent *)theEvent
+{
+    self.cppPlugin->set_toolbar_visible(true);
+
+    [super mouseMoved: theEvent];
+}
+
 @end
 



More information about the vlc-commits mailing list