Commit d77c16d3 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Better center for the fspanel.

* Don't hide if the mousepointer is over the fspanel
parent aefb8674
......@@ -30,10 +30,10 @@
BOOL b_keptVisible;
BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec;
int i_outputScreen;
BOOL b_displayed;
BOOL b_voutWasUpdated;
int i_device;
}
- (id)initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle
......@@ -66,7 +66,7 @@
- (void)mouseDragged:(NSEvent *)theEvent;
- (BOOL)isDisplayed;
- (void)setVoutWasUpdated;
- (void)setVoutWasUpdated: (int) i_screen;
@end
@interface VLCFSPanelView : NSView
......
......@@ -50,6 +50,7 @@
/* let the window sit on top of everything else and start out completely transparent */
[win setLevel:NSFloatingWindowLevel];
[win setAlphaValue:0.0];
i_device = 0;
[win center];
return win;
......@@ -91,15 +92,13 @@
NSPoint theCoordinate;
NSRect theScreensFrame;
NSRect theWindowsFrame;
i_outputScreen = var_GetInteger( VLCIntf->p_vlc, "video-device" );
if( i_outputScreen <= 0 || i_outputScreen > (signed int)[[NSScreen screens] count] )
if( i_device < 0 || i_device >= (signed int)[[NSScreen screens] count] )
/* invalid preferences or none specified, using main screen */
theScreensFrame = [[NSScreen mainScreen] frame];
else
/* user-defined screen */
theScreensFrame = [[[NSScreen screens] objectAtIndex: i_outputScreen-1] frame];
theScreensFrame = [[[NSScreen screens] objectAtIndex: i_device] frame];
theWindowsFrame = [self frame];
......@@ -204,9 +203,6 @@
- (void)fadeIn
{
if( i_outputScreen != var_GetInteger( VLCIntf->p_vlc, "video-device" ) )
[self center];
if( [self alphaValue] < 1.0 )
{
if (![self fadeTimer])
......@@ -219,6 +215,9 @@
- (void)fadeOut
{
if( NSPointInRect([NSEvent mouseLocation],[self frame]))
return;
if( ( [self alphaValue] > 0.0 ) )
{
if (![self fadeTimer])
......@@ -301,9 +300,14 @@
return b_displayed;
}
- (void)setVoutWasUpdated
- (void)setVoutWasUpdated: (int)i_newdevice;
{
b_voutWasUpdated = YES;
if( i_newdevice != i_device )
{
i_device = i_newdevice;
[self center];
}
}
@end
......
......@@ -933,17 +933,17 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( p_vout->b_fullscreen )
{
CGDisplayFadeReservationToken token;
NSRect screen_rect = [o_screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0;
/* move the FSPanel to front in case that it is currently shown
* this won't and is not supposed to work when it's fading right now */
if( [[[[VLCMain sharedInstance] getControls] getFSPanel] isDisplayed] )
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self];
/* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated];
CGDisplayFadeReservationToken token;
NSRect screen_rect = [o_screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0;
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];
/* Creates a window with size: screen_rect on o_screen */
[self initWithContentRect: screen_rect
......
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