]> git.sesse.net Git - vlc/commitdiff
* changed how cursor hiding works. Not perfect, but it's less complicated.
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 6 Nov 2003 16:28:28 +0000 (16:28 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 6 Nov 2003 16:28:28 +0000 (16:28 +0000)
  - 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.

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/playlist.m
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m

index 19f3abba5edb8dd86cfd5c2d0e89100e308aae27..331939e9caebd01777496d740b6087d99fd803b0 100644 (file)
@@ -75,6 +75,7 @@
                 "o_btn_slower" = id; 
                 "o_btn_stop" = id; 
                 "o_controls" = id; 
+                "o_dmi_mute" = id; 
                 "o_dmi_next" = id; 
                 "o_dmi_play" = id; 
                 "o_dmi_previous" = id; 
index c55d1856dd2df00fdd9efae9aeda0e5c401e33f6..b6c2e89fea22d0285b6e5606b5df11959d36365c 100644 (file)
@@ -3,13 +3,13 @@
 <plist version="1.0">
 <dict>
        <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>
        <dict>
+               <key>1617</key>
+               <string>691 686 104 149 0 0 1280 1002 </string>
                <key>29</key>
-               <string>430 938 419 44 0 0 1280 1002 </string>
-               <key>303</key>
-               <string>259 604 104 118 0 0 1280 1002 </string>
+               <string>165 930 419 44 0 0 1280 1002 </string>
                <key>909</key>
                <string>72 297 430 172 0 0 1152 746 </string>
                <key>915</key>
@@ -24,6 +24,7 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>29</integer>
+               <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7B85</string>
index 47e7156d37c7359c3c53c5781753a693a2430130..b9d4b3b561d7226a3b6413d1c7a7eaba8397bdf3 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index dd7929bdf673246d023a04b6ae55244876607e9e..04536cead015a1359327c628182f363c97567d73 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface plugin
  *****************************************************************************
  * 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>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
@@ -81,10 +81,6 @@ int MacVersion102 = -1;
     
     switch( key )
     {
-        case ' ':
-            [(VLCControls *)[[NSApp delegate] getControls] play: nil];
-            break;
-
         case NSDeleteCharacter:
         case NSDeleteFunctionKey:
         case NSDeleteCharFunctionKey:
index cd1e820f60200d2e736171a455783ec6da4b84b0..4e7e92664c5cd7bab7adfe5cbec7735cb85906e4 100644 (file)
@@ -2,7 +2,7 @@
  * vout.h: MacOS X interface plugin
  *****************************************************************************
  * 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>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -79,7 +79,6 @@ struct vout_sys_t
     int isplugin;
 
     vlc_bool_t b_mouse_moved;
-    vlc_bool_t b_mouse_pointer_visible;
     mtime_t i_time_mouse_last_moved;
 
 #ifdef __QUICKTIME__
index 4f69da99e499b986353f8ece408fa37bcea6f40e..607d3ec22077df786308adfe93424634ddd11f29 100644 (file)
@@ -3,7 +3,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * 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>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -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_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->i_time_mouse_last_moved = mdate();
 
@@ -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 */
     if( !p_vout->p_sys->b_mouse_moved && p_vout->b_fullscreen )
     {
-        if( mdate() - p_vout->p_sys->i_time_mouse_last_moved > 2000000 && 
-                   p_vout->p_sys->b_mouse_pointer_visible )
+        if( mdate() - p_vout->p_sys->i_time_mouse_last_moved > 3000000 )
         {
             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 )
     {
-        if( !p_vout->p_sys->b_mouse_pointer_visible )
-        {
-            VLCHideMouse( p_vout, NO );
-        }
-        else
-        {
-            p_vout->p_sys->b_mouse_moved = NO;
-        }
+        VLCHideMouse( p_vout, NO );
     }
     
     return( 0 );
@@ -574,7 +547,7 @@ static int CoCreateWindow( 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 );
     }
@@ -641,13 +614,11 @@ static void VLCHideMouse ( vout_thread_t *p_vout, BOOL b_hide )
     if ( b_hide && b_inside )
     {
         /* only hide if mouse over VLCView */
-        [NSCursor hide];
-        p_vout->p_sys->b_mouse_pointer_visible = 0;
+        [NSCursor setHiddenUntilMouseMoves: YES];
     }
     else if ( !b_hide )
     {
-        [NSCursor unhide];
-        p_vout->p_sys->b_mouse_pointer_visible = 1;
+        [NSCursor setHiddenUntilMouseMoves: NO];
     }
     p_vout->p_sys->b_mouse_moved = NO;
     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 )
 
     if( key )
     {
-        val.i_int |= CocoaConvertKey( key );
-        var_Set( p_vout->p_vlc, "key-pressed", val );
+        /* Escape should always get you out of fullscreen */
+        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
     {
@@ -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->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];
 }