Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
b04f1e54
Commit
b04f1e54
authored
Feb 09, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: only show fspanel when needed, additional fixed for lion fullscreen behavior
parent
60eba2be
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
35 deletions
+71
-35
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+0
-4
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+12
-3
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+4
-2
modules/gui/macosx/VideoView.m
modules/gui/macosx/VideoView.m
+1
-1
modules/gui/macosx/Windows.h
modules/gui/macosx/Windows.h
+13
-2
modules/gui/macosx/Windows.m
modules/gui/macosx/Windows.m
+28
-9
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+1
-6
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+12
-8
No files found.
modules/gui/macosx/MainWindow.h
View file @
b04f1e54
...
...
@@ -92,9 +92,6 @@
BOOL
b_podcastView_displayed
;
/* set to yes if we are fullscreen and all animations are over */
BOOL
b_fullscreen
;
NSTimer
*
t_hide_mouse_timer
;
VLCColorView
*
o_color_backdrop
;
...
...
@@ -102,7 +99,6 @@
NSRect
frameBeforePlayback
;
}
+
(
VLCMainWindow
*
)
sharedInstance
;
@property
(
readwrite
)
BOOL
fullscreen
;
@property
(
readonly
)
BOOL
nativeFullscreenMode
;
@property
(
readwrite
)
BOOL
nonembedded
;
...
...
modules/gui/macosx/MainWindow.m
View file @
b04f1e54
...
...
@@ -56,7 +56,6 @@
@implementation
VLCMainWindow
@synthesize
fullscreen
=
b_fullscreen
;
@synthesize
nativeFullscreenMode
=
b_nativeFullscreenMode
;
@synthesize
nonembedded
=
b_nonembedded
;
@synthesize
fsPanel
=
o_fspanel
;
...
...
@@ -809,8 +808,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
void
)
showFullscreenController
{
if
(
b_fullscreen
&&
[[
VLCMain
sharedInstance
]
activeVideoPlayback
])
[
o_fspanel
fadeIn
];
id
currentWindow
=
[
NSApp
keyWindow
];
if
([
currentWindow
respondsToSelector
:
@selector
(
hasActiveVideo
)]
&&
[
currentWindow
hasActiveVideo
])
{
if
([
currentWindow
respondsToSelector
:
@selector
(
fullscreen
)]
&&
[
currentWindow
fullscreen
])
{
if
([[
VLCMain
sharedInstance
]
activeVideoPlayback
])
[
o_fspanel
fadeIn
];
}
}
}
-
(
void
)
makeKeyAndOrderFront
:
(
id
)
sender
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
b04f1e54
...
...
@@ -198,10 +198,12 @@
return
;
}
if
([
[
VLCMainWindow
sharedInstance
]
fullscreen
]
&&
!
[[
VLCMainWindow
sharedInstance
]
nativeFullscreenMode
])
if
([
o_window
fullscreen
]
&&
!
[[
VLCMainWindow
sharedInstance
]
nativeFullscreenMode
])
[
o_window
leaveFullscreen
];
if
([[
VLCMainWindow
sharedInstance
]
fullscreen
]
&&
[[
VLCMainWindow
sharedInstance
]
nativeFullscreenMode
])
if
(
!
[
NSStringFromClass
([
o_window
class
])
isEqualToString
:
@"VLCMainWindow"
]
&&
[
o_window
fullscreen
]
&&
[[
VLCMainWindow
sharedInstance
]
nativeFullscreenMode
])
[
o_window
toggleFullScreen
:
self
];
...
...
modules/gui/macosx/VideoView.m
View file @
b04f1e54
...
...
@@ -319,7 +319,7 @@
// This is the result of [NSEvent standardMagnificationThreshold].
// Unfortunately, this is a private API, currently.
CGFloat
f_threshold
=
0
.
3
;
BOOL
b_fullscreen
=
[
[
VLCMainWindow
sharedInstance
]
fullscreen
];
BOOL
b_fullscreen
=
[
(
VLCVideoWindowCommon
*
)[
self
window
]
fullscreen
];
if
((
f_cumulated_magnification
>
f_threshold
&&
!
b_fullscreen
)
||
(
f_cumulated_magnification
<
-
f_threshold
&&
b_fullscreen
))
{
f_cumulated_magnification
=
0
.
0
;
...
...
modules/gui/macosx/Windows.h
View file @
b04f1e54
...
...
@@ -40,10 +40,22 @@
BOOL
b_canBecomeMainWindow
;
BOOL
b_isset_canBecomeMainWindow
;
NSViewAnimation
*
o_current_animation
;
BOOL
b_has_active_video
;
/*
* normal fullscreen: YES when all animations are over
* lion fullscreen: toggled when fs animation starts
* for fullscreen window: always YES
*/
BOOL
b_fullscreen
;
}
@property
(
readwrite
)
BOOL
canBecomeKeyWindow
;
@property
(
readwrite
)
BOOL
canBecomeMainWindow
;
@property
(
nonatomic
,
readwrite
)
BOOL
hasActiveVideo
;
@property
(
nonatomic
,
readwrite
)
BOOL
fullscreen
;
/* animate mode is only supported in >=10.4 */
-
(
void
)
orderFront
:
(
id
)
sender
animate
:
(
BOOL
)
animate
;
...
...
@@ -95,12 +107,11 @@ static const float f_min_video_height = 70.0;
NSRecursiveLock
*
o_animation_lock
;
NSInteger
i_originalLevel
;
BOOL
b_has_active_video
;
NSTimer
*
t_hide_mouse_timer
;
}
@property
(
nonatomic
,
assign
)
VLCVoutView
*
videoView
;
@property
(
readonly
)
VLCControlsBarCommon
*
controlsBar
;
@property
(
nonatomic
,
readwrite
)
BOOL
hasActiveVideo
;
-
(
void
)
setWindowLevel
:(
NSInteger
)
i_state
;
...
...
modules/gui/macosx/Windows.m
View file @
b04f1e54
...
...
@@ -35,6 +35,10 @@
*****************************************************************************/
@implementation
VLCWindow
@synthesize
hasActiveVideo
=
b_has_active_video
;
@synthesize
fullscreen
=
b_fullscreen
;
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
styleMask
:(
NSUInteger
)
styleMask
backing
:(
NSBackingStoreType
)
backingType
defer
:(
BOOL
)
flag
{
...
...
@@ -239,7 +243,6 @@
@synthesize
videoView
=
o_video_view
;
@synthesize
controlsBar
=
o_controls_bar
;
@synthesize
hasActiveVideo
=
b_has_active_video
;
#pragma mark -
#pragma mark Init
...
...
@@ -503,7 +506,7 @@
-
(
void
)
resizeWindow
{
if
([
[
VLCMainWindow
sharedInstance
]
fullscreen
])
if
([
self
fullscreen
])
return
;
NSRect
window_rect
=
[
self
getWindowRectForProposedVideoViewSize
:
nativeVideoSize
];
...
...
@@ -524,7 +527,7 @@
return
proposedFrameSize
;
// needed when entering lion fullscreen mode
if
([
[
VLCMainWindow
sharedInstance
]
fullscreen
])
if
([
self
fullscreen
])
return
proposedFrameSize
;
if
([[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
])
{
...
...
@@ -545,11 +548,25 @@
#pragma mark -
#pragma mark Lion native fullscreen handling
-
(
void
)
becomeKeyWindow
{
[
super
becomeKeyWindow
];
// change fspanel state for the case when multiple windows are in fullscreen
if
([
self
hasActiveVideo
]
&&
[
self
fullscreen
])
[[[
VLCMainWindow
sharedInstance
]
fsPanel
]
setActive
:
nil
];
else
[[[
VLCMainWindow
sharedInstance
]
fsPanel
]
setNonActive
:
nil
];
}
-
(
void
)
windowWillEnterFullScreen
:(
NSNotification
*
)
notification
{
// workaround, see #6668
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationFullScreen
|
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
[
self
setFullscreen
:
YES
];
var_SetBool
(
pl_Get
(
VLCIntf
),
"fullscreen"
,
true
);
if
([
self
hasActiveVideo
])
{
...
...
@@ -561,7 +578,6 @@
}
[
o_video_view
setFrame
:
[[
self
contentView
]
frame
]];
[[
VLCMainWindow
sharedInstance
]
setFullscreen
:
YES
];
[[
VLCMainWindow
sharedInstance
]
recreateHideMouseTimer
];
i_originalLevel
=
[
self
level
];
...
...
@@ -609,6 +625,8 @@
-
(
void
)
windowWillExitFullScreen
:(
NSNotification
*
)
notification
{
[
self
setFullscreen
:
NO
];
var_SetBool
(
pl_Get
(
VLCIntf
),
"fullscreen"
,
false
);
if
([
self
hasActiveVideo
])
{
...
...
@@ -621,11 +639,10 @@
[
NSCursor
setHiddenUntilMouseMoves
:
NO
];
[[[
VLCMainWindow
sharedInstance
]
fsPanel
]
setNonActive
:
nil
];
[[[
VLCMain
sharedInstance
]
voutController
]
updateWindowLevelForHelperWindows
:
i_originalLevel
];
[
self
setLevel
:
i_originalLevel
];
[[
VLCMainWindow
sharedInstance
]
setFullscreen
:
NO
];
if
(
b_dark_interface
)
{
NSRect
winrect
;
CGFloat
f_titleBarHeight
=
[
o_titlebar_view
frame
].
size
.
height
;
...
...
@@ -712,6 +729,8 @@
[
o_fullscreen_window
setBackgroundColor
:
[
NSColor
blackColor
]];
[
o_fullscreen_window
setCanBecomeKeyWindow
:
YES
];
[
o_fullscreen_window
setCanBecomeMainWindow
:
YES
];
[
o_fullscreen_window
setHasActiveVideo
:
YES
];
[
o_fullscreen_window
setFullscreen
:
YES
];
if
(
!
[
self
isVisible
]
||
[
self
alphaValue
]
==
0
.
0
)
{
/* We don't animate if we are not visible, instead we
...
...
@@ -761,7 +780,7 @@
}
/* We are in fullscreen (and no animation is running) */
if
([
[
VLCMainWindow
sharedInstance
]
fullscreen
])
{
if
([
self
fullscreen
])
{
/* Make sure we are hidden */
[
self
orderOut
:
self
];
...
...
@@ -834,7 +853,7 @@
if
([
self
isVisible
])
[
self
orderOut
:
self
];
[
[
VLCMainWindow
sharedInstance
]
setFullscreen
:
YES
];
[
self
setFullscreen
:
YES
];
[
self
unlockFullscreenAnimation
];
}
...
...
@@ -950,7 +969,7 @@
-
(
void
)
hasEndedFullscreen
{
[
[
VLCMainWindow
sharedInstance
]
setFullscreen
:
NO
];
[
self
setFullscreen
:
NO
];
/* This function is private and should be only triggered at the end of the fullscreen change animation */
/* Make sure we don't see the o_video_view disappearing of the screen during this operation */
...
...
modules/gui/macosx/fspanel.m
View file @
b04f1e54
...
...
@@ -184,12 +184,7 @@
{
b_nonActive
=
NO
;
id
currentWindow
=
[
NSApp
keyWindow
];
if
([
currentWindow
respondsToSelector
:
@selector
(
hasActiveVideo
)])
{
if
([
currentWindow
hasActiveVideo
])
{
[[
VLCMain
sharedInstance
]
showFullscreenController
];
}
}
[[
VLCMain
sharedInstance
]
showFullscreenController
];
}
/* This routine is called repeatedly to fade in the window */
...
...
modules/gui/macosx/intf.m
View file @
b04f1e54
...
...
@@ -1264,14 +1264,18 @@ static VLCMain *_o_sharedMainInstance = nil;
var_SetBool
(
p_playlist
,
"fullscreen"
,
b_fullscreen
);
if
(
b_nativeFullscreenMode
)
{
// this is called twice in certain situations, so only toogle if we really need to
if
((
b_fullscreen
&&
!
([
NSApp
currentSystemPresentationOptions
]
&
NSApplicationPresentationFullScreen
))
||
(
!
b_fullscreen
&&
([
NSApp
currentSystemPresentationOptions
]
&
NSApplicationPresentationFullScreen
)))
{
if
(
p_wnd
)
{
VLCVideoWindowCommon
*
window
=
[
o_vout_controller
getWindow
:
p_wnd
];
[
window
toggleFullScreen
:
self
];
}
else
[
o_mainwindow
toggleFullScreen
:
self
];
// TODO
VLCVideoWindowCommon
*
o_active_window
=
nil
;
if
(
p_wnd
)
o_active_window
=
[
o_vout_controller
getWindow
:
p_wnd
];
else
o_active_window
=
o_mainwindow
;
// fullscreen might be triggered twice (vout event)
// so ignore duplicate events here
if
((
b_fullscreen
&&
!
[
o_active_window
fullscreen
])
||
(
!
b_fullscreen
&&
[
o_active_window
fullscreen
]))
{
[
o_active_window
toggleFullScreen
:
self
];
}
if
(
b_fullscreen
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment