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
7f84f44d
Commit
7f84f44d
authored
Feb 15, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: move fullscreen logic to VLCVoutController and remove now unneeded helper methods
parent
cf04d7a8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
98 deletions
+87
-98
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/CoreInteraction.m
+1
-1
modules/gui/macosx/VLCVoutWindowController.h
modules/gui/macosx/VLCVoutWindowController.h
+3
-6
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+79
-37
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-2
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+4
-52
No files found.
modules/gui/macosx/CoreInteraction.m
View file @
7f84f44d
...
@@ -622,7 +622,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
...
@@ -622,7 +622,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
else
{
// e.g. lion fullscreen toggle
}
else
{
// e.g. lion fullscreen toggle
BOOL
b_fs
=
var_ToggleBool
(
pl_Get
(
p_intf
),
"fullscreen"
);
BOOL
b_fs
=
var_ToggleBool
(
pl_Get
(
p_intf
),
"fullscreen"
);
[[
VLCMain
sharedInstance
]
setFullscreen
:
b_fs
forWindow
:
nil
];
[[
[
VLCMain
sharedInstance
]
voutController
]
setFullscreen
:
b_fs
forWindow
:
nil
];
}
}
}
}
...
...
modules/gui/macosx/VLCVoutWindowController.h
View file @
7f84f44d
...
@@ -45,16 +45,13 @@
...
@@ -45,16 +45,13 @@
-
(
VLCVoutView
*
)
setupVoutForWindow
:(
vout_window_t
*
)
p_wnd
withProposedVideoViewPosition
:(
NSRect
)
videoViewPosition
;
-
(
VLCVoutView
*
)
setupVoutForWindow
:(
vout_window_t
*
)
p_wnd
withProposedVideoViewPosition
:(
NSRect
)
videoViewPosition
;
-
(
void
)
removeVoutforDisplay
:(
NSValue
*
)
o_key
;
-
(
void
)
removeVoutforDisplay
:(
NSValue
*
)
o_key
;
-
(
void
)
setNativeVideoSize
:(
NSSize
)
size
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
setWindowLevel
:(
NSInteger
)
i_level
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
setFullscreen
:(
int
)
i_full
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
updateWindowsControlsBarWithSelector
:(
SEL
)
aSel
;
-
(
void
)
updateWindowsControlsBarWithSelector
:(
SEL
)
aSel
;
-
(
VLCVideoWindowCommon
*
)
getWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
updateWindowsUsingBlock
:(
void
(
^
)(
VLCVideoWindowCommon
*
o_window
))
windowUpdater
;
-
(
void
)
updateWindowsUsingBlock
:(
void
(
^
)(
VLCVideoWindowCommon
*
o_window
))
windowUpdater
;
-
(
void
)
updateWindow
:(
vout_window_t
*
)
p_wnd
withSelector
:(
SEL
)
aSel
;
-
(
void
)
setNativeVideoSize
:(
NSSize
)
size
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
setWindowLevel
:(
NSInteger
)
i_level
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
updateWindowLevelForHelperWindows
:(
NSInteger
)
i_level
;
-
(
void
)
updateWindowLevelForHelperWindows
:(
NSInteger
)
i_level
;
@end
@end
modules/gui/macosx/VLCVoutWindowController.m
View file @
7f84f44d
...
@@ -53,6 +53,8 @@
...
@@ -53,6 +53,8 @@
[
super
dealloc
];
[
super
dealloc
];
}
}
#pragma mark -
#pragma mark Methods for vout provider
-
(
VLCVoutView
*
)
setupVoutForWindow
:(
vout_window_t
*
)
p_wnd
withProposedVideoViewPosition
:(
NSRect
)
videoViewPosition
-
(
VLCVoutView
*
)
setupVoutForWindow
:(
vout_window_t
*
)
p_wnd
withProposedVideoViewPosition
:(
NSRect
)
videoViewPosition
{
{
...
@@ -217,43 +219,6 @@
...
@@ -217,43 +219,6 @@
[[
VLCMain
sharedInstance
]
setActiveVideoPlayback
:
NO
];
[[
VLCMain
sharedInstance
]
setActiveVideoPlayback
:
NO
];
}
}
-
(
void
)
updateWindowsControlsBarWithSelector
:(
SEL
)
aSel
{
[
o_vout_dict
enumerateKeysAndObjectsUsingBlock
:
^
(
id
key
,
id
obj
,
BOOL
*
stop
)
{
if
([
obj
respondsToSelector
:
@selector
(
controlsBar
)])
{
id
o_controlsBar
=
[
obj
controlsBar
];
if
(
o_controlsBar
)
[
o_controlsBar
performSelector
:
aSel
];
}
}];
}
-
(
void
)
updateWindow
:(
vout_window_t
*
)
p_wnd
withSelector
:(
SEL
)
aSel
;
{
VLCVideoWindowCommon
*
o_window
=
[
o_vout_dict
objectForKey
:[
NSValue
valueWithPointer
:
p_wnd
]];
if
(
!
o_window
)
{
msg_Err
(
VLCIntf
,
"Cannot call selector for nonexisting window"
);
return
;
}
[
o_window
performSelector
:
aSel
];
}
-
(
VLCVideoWindowCommon
*
)
getWindow
:(
vout_window_t
*
)
p_wnd
{
VLCVideoWindowCommon
*
o_window
=
[
o_vout_dict
objectForKey
:[
NSValue
valueWithPointer
:
p_wnd
]];
assert
(
o_window
);
return
o_window
;
}
-
(
void
)
updateWindowsUsingBlock
:(
void
(
^
)(
VLCVideoWindowCommon
*
o_window
))
windowUpdater
{
[
o_vout_dict
enumerateKeysAndObjectsUsingBlock
:
^
(
id
key
,
id
obj
,
BOOL
*
stop
)
{
if
([
obj
isKindOfClass
:
[
NSWindow
class
]])
windowUpdater
(
obj
);
}];
}
-
(
void
)
setNativeVideoSize
:(
NSSize
)
size
forWindow
:(
vout_window_t
*
)
p_wnd
-
(
void
)
setNativeVideoSize
:(
NSSize
)
size
forWindow
:(
vout_window_t
*
)
p_wnd
{
{
...
@@ -288,6 +253,83 @@
...
@@ -288,6 +253,83 @@
[
o_window
setWindowLevel
:
i_level
];
[
o_window
setWindowLevel
:
i_level
];
}
}
-
(
void
)
setFullscreen
:(
int
)
i_full
forWindow
:(
vout_window_t
*
)
p_wnd
{
intf_thread_t
*
p_intf
=
VLCIntf
;
BOOL
b_nativeFullscreenMode
=
[[
VLCMain
sharedInstance
]
nativeFullscreenMode
];
if
(
!
p_intf
||
(
!
b_nativeFullscreenMode
&&
!
p_wnd
))
return
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
BOOL
b_fullscreen
=
i_full
;
if
(
!
var_GetBool
(
p_playlist
,
"fullscreen"
)
!=
!
b_fullscreen
)
var_SetBool
(
p_playlist
,
"fullscreen"
,
b_fullscreen
);
VLCVideoWindowCommon
*
o_current_window
=
nil
;
if
(
p_wnd
)
o_current_window
=
[
o_vout_dict
objectForKey
:[
NSValue
valueWithPointer
:
p_wnd
]];
if
(
b_nativeFullscreenMode
)
{
if
(
!
o_current_window
)
o_current_window
=
[
VLCMainWindow
sharedInstance
];
assert
(
o_current_window
);
// fullscreen might be triggered twice (vout event)
// so ignore duplicate events here
if
((
b_fullscreen
&&
!
([
o_current_window
fullscreen
]
||
[
o_current_window
enteringFullscreenTransition
]))
||
(
!
b_fullscreen
&&
[
o_current_window
fullscreen
]))
{
[
o_current_window
toggleFullScreen
:
self
];
}
if
(
b_fullscreen
)
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationFullScreen
|
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
}
else
{
assert
(
o_current_window
);
if
(
b_fullscreen
)
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
!=
NULL
&&
[[
VLCMain
sharedInstance
]
activeVideoPlayback
])
{
// activate app, as method can also be triggered from outside the app (prevents nasty window layout)
[
NSApp
activateIgnoringOtherApps
:
YES
];
[
o_current_window
enterFullscreen
];
}
if
(
p_input
)
vlc_object_release
(
p_input
);
}
else
{
// leaving fullscreen is always allowed
[
o_current_window
leaveFullscreen
];
}
}
}
#pragma mark -
#pragma mark Misc methods
-
(
void
)
updateWindowsControlsBarWithSelector
:(
SEL
)
aSel
{
[
o_vout_dict
enumerateKeysAndObjectsUsingBlock
:
^
(
id
key
,
id
obj
,
BOOL
*
stop
)
{
if
([
obj
respondsToSelector
:
@selector
(
controlsBar
)])
{
id
o_controlsBar
=
[
obj
controlsBar
];
if
(
o_controlsBar
)
[
o_controlsBar
performSelector
:
aSel
];
}
}];
}
-
(
void
)
updateWindowsUsingBlock
:(
void
(
^
)(
VLCVideoWindowCommon
*
o_window
))
windowUpdater
{
[
o_vout_dict
enumerateKeysAndObjectsUsingBlock
:
^
(
id
key
,
id
obj
,
BOOL
*
stop
)
{
if
([
obj
isKindOfClass
:
[
NSWindow
class
]])
windowUpdater
(
obj
);
}];
}
-
(
void
)
updateWindowLevelForHelperWindows
:(
NSInteger
)
i_level
-
(
void
)
updateWindowLevelForHelperWindows
:(
NSInteger
)
i_level
{
{
if
(
var_InheritBool
(
VLCIntf
,
"video-wallpaper"
))
if
(
var_InheritBool
(
VLCIntf
,
"video-wallpaper"
))
...
...
modules/gui/macosx/intf.h
View file @
7f84f44d
...
@@ -177,8 +177,6 @@ struct intf_sys_t
...
@@ -177,8 +177,6 @@ struct intf_sys_t
-
(
void
)
updateCurrentlyUsedHotkeys
;
-
(
void
)
updateCurrentlyUsedHotkeys
;
-
(
BOOL
)
hasDefinedShortcutKey
:(
NSEvent
*
)
o_event
force
:(
BOOL
)
b_force
;
-
(
BOOL
)
hasDefinedShortcutKey
:(
NSEvent
*
)
o_event
force
:(
BOOL
)
b_force
;
-
(
void
)
setFullscreen
:(
int
)
i_full
forWindow
:(
vout_window_t
*
)
p_wnd
;
-
(
void
)
PlaylistItemChanged
;
-
(
void
)
PlaylistItemChanged
;
-
(
void
)
playbackStatusUpdated
;
-
(
void
)
playbackStatusUpdated
;
-
(
void
)
sendDistributedNotificationWithUpdatedPlaybackStatus
;
-
(
void
)
sendDistributedNotificationWithUpdatedPlaybackStatus
;
...
...
modules/gui/macosx/intf.m
View file @
7f84f44d
...
@@ -172,8 +172,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
...
@@ -172,8 +172,8 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
int
i_full
=
1
;
int
i_full
=
1
;
SEL
sel
=
@selector
(
setFullscreen
:
forWindow
:
);
SEL
sel
=
@selector
(
setFullscreen
:
forWindow
:
);
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[[
VLCMain
sharedInstance
]
methodSignatureForSelector
:
sel
]];
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[[
[
VLCMain
sharedInstance
]
voutController
]
methodSignatureForSelector
:
sel
]];
[
inv
setTarget
:[
VLCMain
sharedInstance
]];
[
inv
setTarget
:[
[
VLCMain
sharedInstance
]
voutController
]];
[
inv
setSelector
:
sel
];
[
inv
setSelector
:
sel
];
[
inv
setArgument
:
&
i_full
atIndex
:
2
];
[
inv
setArgument
:
&
i_full
atIndex
:
2
];
[
inv
setArgument
:
&
p_wnd
atIndex
:
3
];
[
inv
setArgument
:
&
p_wnd
atIndex
:
3
];
...
@@ -236,8 +236,8 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
...
@@ -236,8 +236,8 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
int
i_full
=
va_arg
(
args
,
int
);
int
i_full
=
va_arg
(
args
,
int
);
SEL
sel
=
@selector
(
setFullscreen
:
forWindow
:
);
SEL
sel
=
@selector
(
setFullscreen
:
forWindow
:
);
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[[
VLCMain
sharedInstance
]
methodSignatureForSelector
:
sel
]];
NSInvocation
*
inv
=
[
NSInvocation
invocationWithMethodSignature
:[[
[
VLCMain
sharedInstance
]
voutController
]
methodSignatureForSelector
:
sel
]];
[
inv
setTarget
:[
VLCMain
sharedInstance
]];
[
inv
setTarget
:[
[
VLCMain
sharedInstance
]
voutController
]];
[
inv
setSelector
:
sel
];
[
inv
setSelector
:
sel
];
[
inv
setArgument
:
&
i_full
atIndex
:
2
];
// starting at 2!
[
inv
setArgument
:
&
i_full
atIndex
:
2
];
// starting at 2!
[
inv
setArgument
:
&
p_wnd
atIndex
:
3
];
[
inv
setArgument
:
&
p_wnd
atIndex
:
3
];
...
@@ -1253,54 +1253,6 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -1253,54 +1253,6 @@ static VLCMain *_o_sharedMainInstance = nil;
#pragma mark -
#pragma mark -
#pragma mark Interface updaters
#pragma mark Interface updaters
-
(
void
)
setFullscreen
:(
int
)
i_full
forWindow
:(
vout_window_t
*
)
p_wnd
{
if
(
!
p_intf
||
(
!
b_nativeFullscreenMode
&&
!
p_wnd
))
return
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
BOOL
b_fullscreen
=
i_full
;
if
(
!
var_GetBool
(
p_playlist
,
"fullscreen"
)
!=
!
b_fullscreen
)
var_SetBool
(
p_playlist
,
"fullscreen"
,
b_fullscreen
);
if
(
b_nativeFullscreenMode
)
{
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
]
||
[
o_active_window
enteringFullscreenTransition
]))
||
(
!
b_fullscreen
&&
[
o_active_window
fullscreen
]))
{
[
o_active_window
toggleFullScreen
:
self
];
}
if
(
b_fullscreen
)
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationFullScreen
|
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
}
else
{
assert
(
p_wnd
);
if
(
b_fullscreen
)
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
p_intf
);
if
(
p_input
!=
NULL
&&
[
self
activeVideoPlayback
])
{
// activate app, as method can also be triggered from outside the app (prevents nasty window layout)
[
NSApp
activateIgnoringOtherApps
:
YES
];
[
o_vout_controller
updateWindow
:
p_wnd
withSelector
:
@selector
(
enterFullscreen
)];
}
if
(
p_input
)
vlc_object_release
(
p_input
);
}
else
{
// leaving fullscreen is always allowed
[
o_vout_controller
updateWindow
:
p_wnd
withSelector
:
@selector
(
leaveFullscreen
)];
}
}
}
-
(
void
)
PlaylistItemChanged
-
(
void
)
PlaylistItemChanged
{
{
...
...
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