Commit 0ef251d9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* usability fixes to the fspanel

parent 907f5891
......@@ -4,8 +4,8 @@
* Copyright (C) 2006 the VideoLAN team
* $Id: fspanel.h 16935 2006-10-04 08:19:38Z fkuehne $
*
* Authors: Jrme Decoodt <djc at videolan dot org>
* Felix Khne <fkuehne at videolan dot org>
* Authors: Jérôme Decoodt <djc at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -30,6 +30,9 @@
BOOL b_keptVisible;
BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec;
BOOL b_displayed;
BOOL b_voutWasUpdated;
}
- (id)initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle
......@@ -61,6 +64,8 @@
- (void)mouseDown:(NSEvent *)theEvent;
- (void)mouseDragged:(NSEvent *)theEvent;
- (BOOL)isDisplayed;
- (void)setVoutWasUpdated;
@end
@interface VLCFSPanelView : NSView
......
......@@ -115,10 +115,18 @@
/* This routine is called repeatedly to fade in the window */
- (void)focus:(NSTimer *)timer
{
/* we need to push ourselves to front if the vout window was closed since our last display */
if( b_voutWasUpdated )
{
[self orderFront: self];
b_voutWasUpdated = NO;
}
if( [self alphaValue] < 1.0 )
[self setAlphaValue:[self alphaValue]+0.1];
if( [self alphaValue] >= 1.0 )
{
b_displayed = YES;
[self setAlphaValue: 1.0];
[self setFadeTimer:nil];
if( b_fadeQueued )
......@@ -145,6 +153,7 @@
[self setAlphaValue:[self alphaValue]-0.1];
if( [self alphaValue] <= 0.1 )
{
b_displayed = NO;
[self setAlphaValue:0.0];
[self setFadeTimer:nil];
if( b_fadeQueued )
......@@ -257,6 +266,16 @@
point.y -= mouseClic.y;
[self setFrameOrigin:point];
}
- (BOOL)isDisplayed
{
return b_displayed;
}
- (void)setVoutWasUpdated
{
b_voutWasUpdated = YES;
}
@end
/*****************************************************************************
......
......@@ -654,7 +654,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t value_drawable;
int i_timeout;
id o_return = nil;
vout_thread_t * p_real_vout = [VLCVoutView getRealVout: p_vout];
var_Get( p_vout->p_vlc, "drawable", &value_drawable );
......@@ -934,6 +933,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if( p_vout->b_fullscreen )
{
/* 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;
......
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