]> git.sesse.net Git - vlc/blobdiff - modules/gui/minimal_macosx/voutagl.m
skins2: solve minor problem when opening skin dialog box
[vlc] / modules / gui / minimal_macosx / voutagl.m
index ceddafefc21dc8be009e448908d371288ac16304..848dd0df0c5e2b8ec742af48d2a395f9e3a7dcc7 100644 (file)
@@ -61,7 +61,7 @@ int aglInit( vout_thread_t * p_vout )
 
     AGLPixelFormat pixFormat;
 
-    p_vout->p_sys->b_embedded = VLC_TRUE;
+    p_vout->p_sys->b_embedded = true;
 
     pixFormat = aglChoosePixelFormat(NULL, 0, ATTRIBUTES);
     if( NULL == pixFormat )
@@ -77,14 +77,15 @@ int aglInit( vout_thread_t * p_vout )
         msg_Err( p_vout, "Cannot create AGL context." );
         return VLC_EGENERIC;
     }
-    else {
+    else
+    {
         // tell opengl not to sync buffer swap with vertical retrace (too inefficient)
         GLint param = 0;
         aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, &param);
         aglEnable(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL);
     }
 
-    var_Get( p_vout->p_libvlc, "drawable", &val );
+    var_Get( p_vout->p_libvlc, "drawable-agl", &val );
     p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
     aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
 
@@ -123,7 +124,8 @@ int aglInit( vout_thread_t * p_vout )
 void aglEnd( vout_thread_t * p_vout )
 {
     aglSetCurrentContext(NULL);
-    if( p_vout->p_sys->theWindow ) DisposeWindow( p_vout->p_sys->theWindow );
+    if( p_vout->p_sys->theWindow )
+        DisposeWindow( p_vout->p_sys->theWindow );
     aglDestroyContext(p_vout->p_sys->agl_ctx);
 }
 
@@ -205,7 +207,7 @@ int aglManage( vout_thread_t * p_vout )
             Rect viewBounds;
             Rect clipBounds;
 
-            var_Get( p_vout->p_libvlc, "drawable", &val );
+            var_Get( p_vout->p_libvlc, "drawable-agl", &val );
             p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int;
             aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
 
@@ -367,19 +369,8 @@ int aglControl( vout_thread_t *p_vout, int i_query, va_list args )
             return VLC_SUCCESS;
         }
 
-        case VOUT_REPARENT:
-        {
-            AGLDrawable drawable = (AGLDrawable)va_arg( args, int);
-            if( !p_vout->b_fullscreen && drawable != p_vout->p_sys->agl_drawable )
-            {
-                p_vout->p_sys->agl_drawable = drawable;
-                aglSetDrawable(p_vout->p_sys->agl_ctx, drawable);
-            }
-            return VLC_SUCCESS;
-        }
-
         default:
-            return vout_vaControlDefault( p_vout, i_query, args );
+            return VLC_EGENERIC;
     }
 }
 
@@ -387,7 +378,7 @@ void aglSwap( vout_thread_t * p_vout )
 {
     if( ! p_vout->p_sys->b_clipped_out )
     {
-        p_vout->p_sys->b_got_frame = VLC_TRUE;
+        p_vout->p_sys->b_got_frame = true;
         aglSwapBuffers(p_vout->p_sys->agl_ctx);
     }
     else
@@ -535,15 +526,14 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
                         {
                             vlc_value_t val;
 
-                            val.b_bool = VLC_FALSE;
+                            val.b_bool = false;
                             var_Set((vout_thread_t *) p_vout->p_parent, "fullscreen", val);
                         }
                         else
                         {
                             vlc_value_t val;
 
-                            val.b_bool = VLC_TRUE;
-                            var_Set( p_vout, "mouse-clicked", val );
+                            var_SetBool( p_vout, "mouse-clicked", true );
 
                             var_Get( p_vout, "mouse-button-down", &val );
                             val.i_int &= ~1;
@@ -597,7 +587,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
 
                 var_Set( p_vout, "mouse-y", val );
 
-                val.b_bool = VLC_TRUE;
+                val.b_bool = true;
                 var_Set( p_vout, "mouse-moved", val );
 
                 break;