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
57c73d74
Commit
57c73d74
authored
Mar 15, 2010
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
legacy OS X intf: fixed locking the vout window's AR
parent
644bd843
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
34 deletions
+26
-34
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/embeddedwindow.m
+8
-16
modules/gui/macosx/voutgl.m
modules/gui/macosx/voutgl.m
+18
-18
No files found.
modules/gui/macosx/embeddedwindow.m
View file @
57c73d74
...
...
@@ -248,25 +248,17 @@
-
(
NSSize
)
windowWillResize
:(
NSWindow
*
)
window
toSize
:(
NSSize
)
proposedFrameSize
{
NSView
*
playlist_area
=
[[
o_vertical_split
subviews
]
objectAtIndex
:
1
];
NSRect
newList
=
[
playlist_area
frame
];
if
(
newList
.
size
.
height
<
50
&&
newList
.
size
.
height
>
0
)
{
[
self
togglePlaylist
:
self
];
}
/* With no video open or with the playlist open the behavior is odd */
if
(
newList
.
size
.
height
>
50
)
return
proposedFrameSize
;
if
(
videoRatio
.
height
==
0
.
||
videoRatio
.
width
==
0
.
)
return
proposedFrameSize
;
NSRect
viewRect
=
[
o_view
convertRect
:[
o_view
bounds
]
toView
:
nil
];
NSRect
contentRect
=
[
self
contentRectForFrameRect
:[
self
frame
]];
float
marginy
=
viewRect
.
origin
.
y
+
[
self
frame
].
size
.
height
-
contentRect
.
size
.
height
;
float
marginx
=
contentRect
.
size
.
width
-
viewRect
.
size
.
width
;
proposedFrameSize
.
height
=
(
proposedFrameSize
.
width
-
marginx
)
*
videoRatio
.
height
/
videoRatio
.
width
+
marginy
;
if
(
[[[
VLCMain
sharedInstance
]
controls
]
aspectRatioIsLocked
]
)
{
NSRect
viewRect
=
[
o_view
convertRect
:[
o_view
bounds
]
toView
:
nil
];
NSRect
contentRect
=
[
self
contentRectForFrameRect
:[
self
frame
]];
float
marginy
=
viewRect
.
origin
.
y
+
[
self
frame
].
size
.
height
-
contentRect
.
size
.
height
;
float
marginx
=
contentRect
.
size
.
width
-
viewRect
.
size
.
width
;
proposedFrameSize
.
height
=
(
proposedFrameSize
.
width
-
marginx
)
*
videoRatio
.
height
/
videoRatio
.
width
+
marginy
;
}
return
proposedFrameSize
;
}
...
...
modules/gui/macosx/voutgl.m
View file @
57c73d74
...
...
@@ -146,7 +146,7 @@ int OpenVideoGL ( vlc_object_t * p_this )
free
(
p_vout
->
p_sys
);
return
VLC_EGENERIC
;
}
p_vout
->
p_sys
->
agl_ctx
=
aglCreateContext
(
pixFormat
,
NULL
);
aglDestroyPixelFormat
(
pixFormat
);
if
(
NULL
==
p_vout
->
p_sys
->
agl_ctx
)
...
...
@@ -363,7 +363,7 @@ static void Unlock( vout_thread_t * p_vout )
#define o_glview p_vout->p_sys->o_glview
o_glview
=
[[
VLCGLView
alloc
]
initWithVout
:
p_vout
];
[
o_glview
autorelease
];
if
(
p_vout
->
p_sys
->
b_saved_frame
)
{
id
old_vout
=
p_vout
->
p_sys
->
o_vout_view
;
...
...
@@ -505,12 +505,12 @@ static void Unlock( vout_thread_t * p_vout )
-
(
void
)
renewGState
{
NSWindow
*
window
=
[
self
window
];
if
([
window
respondsToSelector
:
@selector
(
disableScreenUpdatesUntilFlush
)])
{
[
window
disableScreenUpdatesUntilFlush
];
}
[
super
renewGState
];
}
...
...
@@ -530,7 +530,7 @@ static int aglInit( vout_thread_t * p_vout )
{
Rect
viewBounds
;
Rect
clipBounds
;
p_vout
->
p_sys
->
agl_drawable
=
(
AGLDrawable
)
var_GetInteger
(
p_vout
->
p_libvlc
,
"drawable-agl"
);
aglSetDrawable
(
p_vout
->
p_sys
->
agl_ctx
,
p_vout
->
p_sys
->
agl_drawable
);
...
...
@@ -675,10 +675,10 @@ static int aglManage( vout_thread_t * p_vout )
{
/* Go into fullscreen */
Rect
deviceRect
;
GDHandle
deviceHdl
=
GetMainDevice
();
deviceRect
=
(
*
deviceHdl
)
->
gdRect
;
if
(
!
p_vout
->
p_sys
->
theWindow
)
{
/* Create a window */
...
...
@@ -688,7 +688,7 @@ static int aglManage( vout_thread_t * p_vout )
|
kWindowStandardHandlerAttribute
|
kWindowLiveResizeAttribute
|
kWindowNoShadowAttribute
;
windowAttrs
&=
(
~
kWindowResizableAttribute
);
CreateNewWindow
(
kDocumentWindowClass
,
windowAttrs
,
&
deviceRect
,
&
p_vout
->
p_sys
->
theWindow
);
...
...
@@ -698,14 +698,14 @@ static int aglManage( vout_thread_t * p_vout )
SetWindowGroup
(
p_vout
->
p_sys
->
theWindow
,
p_vout
->
p_sys
->
winGroup
);
SetWindowGroupParent
(
p_vout
->
p_sys
->
winGroup
,
GetWindowGroupOfClass
(
kDocumentWindowClass
)
)
;
}
// Window title
CFStringRef
titleKey
=
CFSTR
(
"Fullscreen VLC media plugin"
);
CFStringRef
windowTitle
=
CFCopyLocalizedString
(
titleKey
,
NULL
);
SetWindowTitleWithCFString
(
p_vout
->
p_sys
->
theWindow
,
windowTitle
);
CFRelease
(
titleKey
);
CFRelease
(
windowTitle
);
//Install event handler
static
const
EventTypeSpec
win_events
[]
=
{
{
kEventClassMouse
,
kEventMouseDown
},
...
...
@@ -762,7 +762,7 @@ static int aglControl( vout_thread_t *p_vout, int i_query, va_list args )
clipBounds
.
left
=
va_arg
(
args
,
int
);
clipBounds
.
bottom
=
va_arg
(
args
,
int
);
clipBounds
.
right
=
va_arg
(
args
,
int
);
if
(
!
p_vout
->
b_fullscreen
)
{
/*
...
...
@@ -881,7 +881,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
{
HICommand
theHICommand
;
GetEventParameter
(
event
,
kEventParamDirectObject
,
typeHICommand
,
NULL
,
sizeof
(
HICommand
),
NULL
,
&
theHICommand
);
switch
(
theHICommand
.
commandID
)
{
default:
...
...
@@ -892,7 +892,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
{
WindowRef
window
;
Rect
rectPort
=
{
0
,
0
,
0
,
0
};
GetEventParameter
(
event
,
kEventParamDirectObject
,
typeWindowRef
,
NULL
,
sizeof
(
WindowRef
),
NULL
,
&
window
);
if
(
window
)
...
...
@@ -906,7 +906,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
case
kEventWindowZoomed
:
case
kEventWindowBoundsChanged
:
break
;
default:
result
=
eventNotHandledErr
;
}
...
...
@@ -918,7 +918,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
case
kEventMouseDown
:
{
UInt16
button
;
GetEventParameter
(
event
,
kEventParamMouseButton
,
typeMouseButton
,
NULL
,
sizeof
(
button
),
NULL
,
&
button
);
switch
(
button
)
{
...
...
@@ -958,7 +958,7 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
case
kEventMouseUp
:
{
UInt16
button
;
GetEventParameter
(
event
,
kEventParamMouseButton
,
typeMouseButton
,
NULL
,
sizeof
(
button
),
NULL
,
&
button
);
switch
(
button
)
{
...
...
@@ -1024,13 +1024,13 @@ static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, Event
vout_PlacePicture
(
p_vout
,
i_width
,
i_height
,
&
i_x
,
&
i_y
,
&
i_width
,
&
i_height
);
GetEventParameter
(
event
,
kEventParamWindowMouseLocation
,
typeQDPoint
,
NULL
,
sizeof
(
Point
),
NULL
,
&
ml
);
x
=
(((
int
)
ml
.
h
)
-
i_x
)
*
p_vout
->
render
.
i_width
/
i_width
;
y
=
(((
int
)
ml
.
v
)
-
i_y
)
*
p_vout
->
render
.
i_height
/
i_height
;
var_SetCoords
(
p_vout
,
"mouse-moved"
,
x
,
y
);
break
;
}
default:
result
=
eventNotHandledErr
;
}
...
...
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