/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h>
+#include <vlc_common.h>
#include <vlc_keys.h>
#include "intf.h"
int OpenVideoGL ( vlc_object_t * p_this )
{
vout_thread_t * p_vout = (vout_thread_t *) p_this;
- vlc_value_t value_drawable;
if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
{
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
#ifndef __x86_64__
- var_Get( p_vout->p_libvlc, "drawable-agl", &value_drawable );
- if( value_drawable.i_int != 0 )
+ int i_drawable_agl;
+ i_drawable_agl = var_GetInteger( p_vout->p_libvlc, "drawable-agl" );
+ if( i_drawable_agl > 0 )
{
static const GLint ATTRIBUTES[] = {
AGL_WINDOW,
{
vout_thread_t * p_vout = (vout_thread_t *) p_this;
- msg_Dbg( p_this, "Closing" );
#ifndef __x86_64__
- /* If the fullscreen window is still open, close it */
- if( p_vout->b_fullscreen )
+ if( p_vout->p_sys->b_embedded )
{
- p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
- if( p_vout->p_sys->b_embedded )
+ /* If the fullscreen window is still open, close it */
+ if( p_vout->b_fullscreen )
{
+ p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
aglManage( p_vout );
var_SetBool( p_vout->p_parent, "fullscreen", false );
}
- else
- Manage( p_vout );
- }
-
- if( p_vout->p_sys->b_embedded )
- {
if( p_vout->p_sys->agl_ctx )
{
aglEnd( p_vout );
aglDestroyContext(p_vout->p_sys->agl_ctx);
}
}
- else if(VLCIntf && vlc_object_alive (VLCIntf))
- {
- NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
-
- /* Close the window */
- [p_vout->p_sys->o_vout_view performSelectorOnMainThread:@selector(closeVout) withObject:NULL waitUntilDone:YES];
-
- [o_pool release];
- }
-#else
- if(VLCIntf && vlc_object_alive (VLCIntf))
+ else
+#endif
+ if(VLCIntf && vlc_object_alive (VLCIntf))
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
[o_pool release];
}
-#endif
/* Clean up */
free( p_vout->p_sys );
}
Unlock( p_vout );
}
+- (void) renewGState
+{
+ NSWindow *window = [self window];
+
+ if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
+ {
+ [window disableScreenUpdatesUntilFlush];
+ }
+
+ [super renewGState];
+}
+
@end
/*****************************************************************************
else
{
vlc_value_t val;
+ int x, y;
- var_SetBool( p_vout, "mouse-clicked", true );
+ var_GetCoords( p_vout, "mouse-moved", &x, &y );
+ var_SetCoords( p_vout, "mouse-clicked", x, y );
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~1;
unsigned int i_x, i_y;
unsigned int i_height = p_vout->p_sys->i_height;
unsigned int i_width = p_vout->p_sys->i_width;
+ int x, y;
vout_PlacePicture(p_vout, i_width, i_height, &i_x, &i_y, &i_width, &i_height);
GetEventParameter(event, kEventParamWindowMouseLocation, typeQDPoint, NULL, sizeof(Point), NULL, &ml);
- val.i_int = ( ((int)ml.h) - i_x ) *
- p_vout->render.i_width / i_width;
- var_Set( p_vout, "mouse-x", val );
-
- val.i_int = ( ((int)ml.v) - i_y ) *
- p_vout->render.i_height / i_height;
-
- var_Set( p_vout, "mouse-y", val );
-
- val.b_bool = true;
- var_Set( p_vout, "mouse-moved", val );
-
+ x = (((int)ml.h) - i_x) * p_vout->render.i_width / i_width;
+ y = (((int)ml.v) - i_y) * p_vout->render.i_height / i_height;
+ var_SetCoords( p_vout, "mouse-moved", x, y );
break;
}