Commit 56a43112 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* changed how cursor hiding works. Not perfect, but it's less complicated.

  - less vague bugs :)
* changed the global hotkey for play/pause to command-p since 'space' won't be
  defined as the hotkey. i was sick of all the hacks i had made to have it work
  that way, so the end. space only works in the vout from now on.
parent dbe002fd
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
"o_btn_slower" = id; "o_btn_slower" = id;
"o_btn_stop" = id; "o_btn_stop" = id;
"o_controls" = id; "o_controls" = id;
"o_dmi_mute" = id;
"o_dmi_next" = id; "o_dmi_next" = id;
"o_dmi_play" = id; "o_dmi_play" = id;
"o_dmi_previous" = id; "o_dmi_previous" = id;
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>23 160 772 722 0 0 1280 1002 </string> <string>53 61 772 722 0 0 1280 1002 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key>
<string>691 686 104 149 0 0 1280 1002 </string>
<key>29</key> <key>29</key>
<string>430 938 419 44 0 0 1280 1002 </string> <string>165 930 419 44 0 0 1280 1002 </string>
<key>303</key>
<string>259 604 104 118 0 0 1280 1002 </string>
<key>909</key> <key>909</key>
<string>72 297 430 172 0 0 1152 746 </string> <string>72 297 430 172 0 0 1152 746 </string>
<key>915</key> <key>915</key>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>29</integer> <integer>29</integer>
<integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7B85</string> <string>7B85</string>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin * playlist.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.34 2003/10/19 23:12:16 hartman Exp $ * $Id: playlist.m,v 1.35 2003/11/06 16:28:28 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -81,10 +81,6 @@ int MacVersion102 = -1; ...@@ -81,10 +81,6 @@ int MacVersion102 = -1;
switch( key ) switch( key )
{ {
case ' ':
[(VLCControls *)[[NSApp delegate] getControls] play: nil];
break;
case NSDeleteCharacter: case NSDeleteCharacter:
case NSDeleteFunctionKey: case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey: case NSDeleteCharFunctionKey:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin * vout.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.h,v 1.14 2003/11/05 00:40:08 hartman Exp $ * $Id: vout.h,v 1.15 2003/11/06 16:28:28 hartman Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -79,7 +79,6 @@ struct vout_sys_t ...@@ -79,7 +79,6 @@ struct vout_sys_t
int isplugin; int isplugin;
vlc_bool_t b_mouse_moved; vlc_bool_t b_mouse_moved;
vlc_bool_t b_mouse_pointer_visible;
mtime_t i_time_mouse_last_moved; mtime_t i_time_mouse_last_moved;
#ifdef __QUICKTIME__ #ifdef __QUICKTIME__
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* vout.m: MacOS X video output plugin * vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.62 2003/11/05 00:40:08 hartman Exp $ * $Id: vout.m,v 1.63 2003/11/06 16:28:28 hartman Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -143,7 +143,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this ) ...@@ -143,7 +143,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
p_vout->p_sys->p_matrix = (MatrixRecordPtr)malloc( sizeof(MatrixRecord) ); p_vout->p_sys->p_matrix = (MatrixRecordPtr)malloc( sizeof(MatrixRecord) );
p_vout->p_sys->p_fullscreen_state = NULL; p_vout->p_sys->p_fullscreen_state = NULL;
p_vout->p_sys->b_mouse_pointer_visible = VLC_TRUE;
p_vout->p_sys->b_mouse_moved = VLC_TRUE; p_vout->p_sys->b_mouse_moved = VLC_TRUE;
p_vout->p_sys->i_time_mouse_last_moved = mdate(); p_vout->p_sys->i_time_mouse_last_moved = mdate();
...@@ -423,40 +422,14 @@ static int vout_Manage( vout_thread_t *p_vout ) ...@@ -423,40 +422,14 @@ static int vout_Manage( vout_thread_t *p_vout )
* it has to deal with multiple monitors and therefore checks a lot */ * it has to deal with multiple monitors and therefore checks a lot */
if( !p_vout->p_sys->b_mouse_moved && p_vout->b_fullscreen ) if( !p_vout->p_sys->b_mouse_moved && p_vout->b_fullscreen )
{ {
if( mdate() - p_vout->p_sys->i_time_mouse_last_moved > 2000000 && if( mdate() - p_vout->p_sys->i_time_mouse_last_moved > 3000000 )
p_vout->p_sys->b_mouse_pointer_visible )
{ {
VLCHideMouse( p_vout, YES ); VLCHideMouse( p_vout, YES );
} }
else if ( !p_vout->p_sys->b_mouse_pointer_visible )
{
vlc_bool_t b_playing = NO;
input_thread_t * p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if ( p_input != NULL )
{
vlc_value_t state;
var_Get( p_input, "state", &state );
b_playing = state.i_int != PAUSE_S;
vlc_object_release( p_input );
}
if ( !b_playing )
{
VLCHideMouse( p_vout, NO );
}
}
} }
else if ( p_vout->p_sys->b_mouse_moved && p_vout->b_fullscreen ) else if ( p_vout->p_sys->b_mouse_moved && p_vout->b_fullscreen )
{ {
if( !p_vout->p_sys->b_mouse_pointer_visible ) VLCHideMouse( p_vout, NO );
{
VLCHideMouse( p_vout, NO );
}
else
{
p_vout->p_sys->b_mouse_moved = NO;
}
} }
return( 0 ); return( 0 );
...@@ -574,7 +547,7 @@ static int CoCreateWindow( vout_thread_t *p_vout ) ...@@ -574,7 +547,7 @@ static int CoCreateWindow( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
static int CoDestroyWindow( vout_thread_t *p_vout ) static int CoDestroyWindow( vout_thread_t *p_vout )
{ {
if( !p_vout->p_sys->b_mouse_pointer_visible ) if( [[NSCursor currentCursor] image] == NULL )
{ {
VLCHideMouse( p_vout, NO ); VLCHideMouse( p_vout, NO );
} }
...@@ -641,13 +614,11 @@ static void VLCHideMouse ( vout_thread_t *p_vout, BOOL b_hide ) ...@@ -641,13 +614,11 @@ static void VLCHideMouse ( vout_thread_t *p_vout, BOOL b_hide )
if ( b_hide && b_inside ) if ( b_hide && b_inside )
{ {
/* only hide if mouse over VLCView */ /* only hide if mouse over VLCView */
[NSCursor hide]; [NSCursor setHiddenUntilMouseMoves: YES];
p_vout->p_sys->b_mouse_pointer_visible = 0;
} }
else if ( !b_hide ) else if ( !b_hide )
{ {
[NSCursor unhide]; [NSCursor setHiddenUntilMouseMoves: NO];
p_vout->p_sys->b_mouse_pointer_visible = 1;
} }
p_vout->p_sys->b_mouse_moved = NO; p_vout->p_sys->b_mouse_moved = NO;
p_vout->p_sys->i_time_mouse_last_moved = mdate(); p_vout->p_sys->i_time_mouse_last_moved = mdate();
...@@ -1004,8 +975,29 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1004,8 +975,29 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
if( key ) if( key )
{ {
val.i_int |= CocoaConvertKey( key ); /* Escape should always get you out of fullscreen */
var_Set( p_vout->p_vlc, "key-pressed", val ); if( key == (unichar) 0x1b )
{
if( [self isFullscreen] )
{
[self toggleFullscreen];
}
}
else if ( key == ' ' )
{
playlist_t *p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if ( p_playlist != NULL )
{
playlist_Pause( p_playlist );
vlc_object_release( p_playlist);
}
}
else
{
val.i_int |= CocoaConvertKey( key );
var_Set( p_vout->p_vlc, "key-pressed", val );
}
} }
else else
{ {
...@@ -1306,13 +1298,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1306,13 +1298,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
p_vout->p_sys->i_time_mouse_last_moved = mdate(); p_vout->p_sys->i_time_mouse_last_moved = mdate();
p_vout->p_sys->b_mouse_moved = YES; p_vout->p_sys->b_mouse_moved = YES;
} }
else if ( !b_inside && !p_vout->p_sys->b_mouse_pointer_visible )
{
/* people with multiple monitors need their mouse,
* even if VLCView in fullscreen. */
VLCHideMouse( p_vout, NO );
}
[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