Commit 6c30ac68 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* also forward the mouse events to super if no vout is present

parent bcc2752b
...@@ -479,19 +479,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -479,19 +479,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" ); msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
} }
}
/* always forward to core as well */
[super mouseDown: o_event]; [super mouseDown: o_event];
}
} }
- (void)otherMouseDown:(NSEvent *)o_event - (void)otherMouseDown:(NSEvent *)o_event
{ {
vlc_value_t val; vlc_value_t val;
if( p_vout ) if( p_vout && [o_event type] == NSOtherMouseDown )
{
if( [o_event type] == NSOtherMouseDown )
{ {
var_Get( p_vout, "mouse-button-down", &val ); var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 2; val.i_int |= 2;
...@@ -499,30 +496,24 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -499,30 +496,24 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
} }
[super mouseDown: o_event]; [super mouseDown: o_event];
}
} }
- (void)rightMouseDown:(NSEvent *)o_event - (void)rightMouseDown:(NSEvent *)o_event
{ {
if( p_vout ) if( p_vout && [o_event type] == NSRightMouseDown )
{
if( [o_event type] == NSRightMouseDown )
{ {
msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" ); msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
} }
[super mouseDown: o_event]; [super mouseDown: o_event];
}
} }
- (void)mouseUp:(NSEvent *)o_event - (void)mouseUp:(NSEvent *)o_event
{ {
vlc_value_t val; vlc_value_t val;
if( p_vout ) if( p_vout && [o_event type] == NSLeftMouseUp )
{
if( [o_event type] == NSLeftMouseUp )
{ {
vlc_value_t b_val; vlc_value_t b_val;
b_val.b_bool = VLC_TRUE; b_val.b_bool = VLC_TRUE;
...@@ -534,16 +525,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -534,16 +525,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
} }
[super mouseUp: o_event]; [super mouseUp: o_event];
}
} }
- (void)otherMouseUp:(NSEvent *)o_event - (void)otherMouseUp:(NSEvent *)o_event
{ {
vlc_value_t val; vlc_value_t val;
if( p_vout ) if( p_vout && [o_event type] == NSOtherMouseUp )
{
if( [o_event type] == NSOtherMouseUp )
{ {
var_Get( p_vout, "mouse-button-down", &val ); var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~2; val.i_int &= ~2;
...@@ -551,22 +539,19 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -551,22 +539,19 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
} }
[super mouseUp: o_event]; [super mouseUp: o_event];
}
} }
- (void)rightMouseUp:(NSEvent *)o_event - (void)rightMouseUp:(NSEvent *)o_event
{ {
if( p_vout ) if( p_vout && [o_event type] == NSRightMouseUp )
{
if( [o_event type] == NSRightMouseUp )
{ {
/* FIXME: this isn't the appropriate place, but we can't receive /* FIXME: this isn't the appropriate place, but we can't receive
* NSRightMouseDown some how */ * NSRightMouseDown some how */
msg_Dbg( p_vout, "received NSRightMouseUp" ); msg_Dbg( p_vout, "received NSRightMouseUp" );
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
} }
[super mouseUp: o_event]; [super mouseUp: o_event];
}
} }
- (void)mouseDragged:(NSEvent *)o_event - (void)mouseDragged:(NSEvent *)o_event
...@@ -625,6 +610,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -625,6 +610,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
var_Set( p_vout, "mouse-moved", val ); var_Set( p_vout, "mouse-moved", val );
} }
} }
[super mouseMoved: o_event]; [super mouseMoved: o_event];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment