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
c655f7ab
Commit
c655f7ab
authored
Nov 18, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport [19128]. (Close the embedded window only when playlist stops on Mac OS X).
parent
c774cbda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
5 deletions
+56
-5
modules/gui/macosx/embeddedwindow.h
modules/gui/macosx/embeddedwindow.h
+2
-0
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/embeddedwindow.m
+8
-0
modules/gui/macosx/vout.m
modules/gui/macosx/vout.m
+46
-5
No files found.
modules/gui/macosx/embeddedwindow.h
View file @
c655f7ab
...
...
@@ -59,6 +59,8 @@
-
(
void
)
setSeekable
:(
BOOL
)
b_seekable
;
-
(
void
)
setFullscreen
:(
BOOL
)
b_fullscreen
;
-
(
NSView
*
)
mainView
;
-
(
BOOL
)
isFullscreen
;
-
(
void
)
lockFullscreenAnimation
;
...
...
modules/gui/macosx/embeddedwindow.m
View file @
c655f7ab
...
...
@@ -141,6 +141,14 @@
return
YES
;
}
-
(
NSView
*
)
mainView
{
if
(
o_fullscreen_window
)
return
o_temp_view
;
else
return
o_view
;
}
/*****************************************************************************
* Fullscreen support
*/
...
...
modules/gui/macosx/vout.m
View file @
c655f7ab
...
...
@@ -43,6 +43,7 @@
#include "fspanel.h"
#include "vout.h"
#import "controls.h"
#include "embeddedwindow.h"
/*****************************************************************************
* DeviceCallback: Callback triggered when the video-device variable is changed
...
...
@@ -238,6 +239,15 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[
o_view
setFrameSize
:
[
self
frame
].
size
];
}
-
(
void
)
drawRect
:(
NSRect
)
rect
{
/* When there is no subview we draw a black background */
[
self
lockFocus
];
[[
NSColor
blackColor
]
set
];
NSRectFill
(
rect
);
[
self
unlockFocus
];
}
-
(
void
)
closeVout
{
[
o_view
removeFromSuperview
];
...
...
@@ -314,6 +324,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
if
(
!
p_vout
->
b_fullscreen
)
{
NSView
*
mainView
;
NSRect
new_frame
;
topleftbase
.
x
=
0
;
topleftbase
.
y
=
[
o_window
frame
].
size
.
height
;
...
...
@@ -335,11 +346,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
newsize
.
height
=
(
int
)
(
i_corrected_height
*
factor
);
}
/* In fullscreen mode we need to use a view that is different from
* ourselves, with the VLCEmbeddedWindow */
if
([
o_window
isKindOfClass
:[
VLCEmbeddedWindow
class
]])
mainView
=
[
o_window
mainView
];
else
mainView
=
self
;
/* Calculate the window's new size */
new_frame
.
size
.
width
=
[
o_window
frame
].
size
.
width
-
[
self
frame
].
size
.
width
+
newsize
.
width
;
[
mainView
frame
].
size
.
width
+
newsize
.
width
;
new_frame
.
size
.
height
=
[
o_window
frame
].
size
.
height
-
[
self
frame
].
size
.
height
+
newsize
.
height
;
[
mainView
frame
].
size
.
height
+
newsize
.
height
;
new_frame
.
origin
.
x
=
topleftscreen
.
x
;
new_frame
.
origin
.
y
=
topleftscreen
.
y
-
new_frame
.
size
.
height
;
...
...
@@ -878,19 +896,42 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{
BOOL
b_return
=
[
super
setVout
:
p_arg_vout
subView
:
view
frame
:
s_arg_frame
];
/* o_window needs to point to our o_embeddedwindow, super might have set it
* to the fullscreen window that o_embeddedwindow setups during fullscreen */
o_window
=
o_embeddedwindow
;
if
(
b_return
)
{
[
o_window
lockFullscreenAnimation
];
[
o_window
setAlphaValue
:
var_GetFloat
(
p_vout
,
"macosx-opaqueness"
)];
[
self
updateTitle
];
[
self
scaleWindowWithFactor
:
1
.
0
animate
:
NO
];
[
o_window
makeKeyAndOrderFront
:
self
];
/* Make the window the front and key window before animating */
if
([
o_window
isVisible
]
&&
(
!
[
o_window
isFullscreen
]))
[
o_window
makeKeyAndOrderFront
:
self
];
[
self
scaleWindowWithFactor
:
1
.
0
animate
:
[
o_window
isVisible
]
&&
(
!
[
o_window
isFullscreen
])];
/* Make sure our window is visible, if we are not in fullscreen */
if
(
!
[
o_window
isFullscreen
])
[
o_window
makeKeyAndOrderFront
:
self
];
[
o_window
unlockFullscreenAnimation
];
}
return
b_return
;
}
-
(
void
)
closeVout
{
[
o_window
orderOut
:
self
];
playlist_t
*
p_playlist
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
playlist_IsPlaying
(
p_playlist
))
[
o_window
performSelectorOnMainThread
:
@selector
(
orderOut
:)
withObject
:
self
waitUntilDone
:
YES
];
vlc_object_release
(
p_playlist
);
[
super
closeVout
];
}
...
...
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