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
5e0dd9dd
Commit
5e0dd9dd
authored
Apr 15, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/gui/wxwindows/video.cpp: some fixes for the recent breakage.
parent
8e0a5a24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
70 deletions
+22
-70
modules/gui/wxwindows/video.cpp
modules/gui/wxwindows/video.cpp
+22
-70
No files found.
modules/gui/wxwindows/video.cpp
View file @
5e0dd9dd
...
...
@@ -67,6 +67,7 @@ private:
wxWindow
*
p_parent
;
vlc_mutex_t
lock
;
vlc_bool_t
b_shown
;
vlc_bool_t
b_auto_size
;
wxWindow
*
p_child_window
;
...
...
@@ -110,11 +111,11 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
vlc_mutex_init
(
p_intf
,
&
lock
);
int
size_to_video
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
);
b_auto_size
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
);
p_vout
=
NULL
;
m_hide_timer
.
SetOwner
(
this
,
ID_HIDE_TIMER
);
m_hide_timer
.
SetOwner
(
this
,
ID_HIDE_TIMER
);
p_intf
->
pf_request_window
=
::
GetWindow
;
p_intf
->
pf_release_window
=
::
ReleaseWindow
;
...
...
@@ -123,36 +124,23 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
p_intf
->
p_sys
->
p_video_window
=
this
;
wxSize
child_size
=
wxSize
(
0
,
0
);
if
(
!
size_to_video
)
if
(
!
b_auto_size
)
{
//m
aybe this size should be an option
child_size
=
wxSize
(
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_X
)
/
2
,
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_Y
)
/
2
);
// M
aybe this size should be an option
child_size
=
wxSize
(
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_X
)
/
2
,
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_Y
)
/
2
);
SetSize
(
child_size
);
SetSize
(
child_size
);
}
p_child_window
=
new
wxWindow
(
this
,
-
1
,
wxDefaultPosition
,
child_size
);
if
(
!
size_to_video
)
{
//show the window so we can see the background where the video will be
p_child_window
->
Show
();
Show
();
b_shown
=
VLC_TRUE
;
}
else
{
//othewise the video window is shown when a video starts
//but hide it now, so we can set the background color without it showing
p_child_window
->
Hide
();
Hide
();
b_shown
=
VLC_FALSE
;
}
p_child_window
->
SetBackgroundColour
(
*
wxBLACK
);
SetBackgroundColour
(
*
wxBLACK
);
p_child_window
->
SetBackgroundColour
(
*
wxBLACK
);
SetBackgroundColour
(
*
wxBLACK
);
p_intf
->
p_sys
->
p_video_sizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
p_intf
->
p_sys
->
p_video_sizer
->
Add
(
this
,
1
,
wxEXPAND
);
...
...
@@ -260,31 +248,26 @@ static void ReleaseWindow( intf_thread_t *p_intf, void *p_window )
void
VideoWindow
::
ReleaseWindow
(
void
*
p_window
)
{
if
(
!
b_auto_size
)
return
;
vlc_mutex_lock
(
&
lock
);
p_vout
=
NULL
;
int
size_to_video
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
);
if
(
size_to_video
)
{
#if defined(__WXGTK__) || defined(WIN32)
wxSizeEvent
event
(
wxSize
(
0
,
0
),
UpdateHide_Event
);
AddPendingEvent
(
event
);
#endif
}
vlc_mutex_unlock
(
&
lock
);
}
void
VideoWindow
::
UpdateSize
(
wxEvent
&
_event
)
{
int
size_to_video
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
);
m_hide_timer
.
Stop
();
if
(
size_to_video
)
{
if
(
!
b_auto_size
)
return
;
wxSizeEvent
*
event
=
(
wxSizeEvent
*
)(
&
_event
);
if
(
!
b_shown
)
{
...
...
@@ -298,38 +281,10 @@ void VideoWindow::UpdateSize( wxEvent &_event )
wxCommandEvent
intf_event
(
wxEVT_INTF
,
0
);
p_parent
->
AddPendingEvent
(
intf_event
);
}
else
{
//this is a very hackish way to show in case the user switched
//size-to-video off while no video was playing, which would leave
//the window hidden and of 0 size
if
(
!
b_shown
)
{
p_intf
->
p_sys
->
p_video_sizer
->
Show
(
this
,
TRUE
);
SetFocus
();
b_shown
=
VLC_TRUE
;
wxSize
child_size
=
wxSize
(
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_X
)
/
2
,
wxSystemSettings
::
GetMetric
(
wxSYS_SCREEN_Y
)
/
2
);
SetSize
(
child_size
);
p_child_window
->
SetSize
(
child_size
);
Interface
*
intf
=
(
Interface
*
)
p_parent
;
intf
->
frame_sizer
->
Layout
();
intf
->
frame_sizer
->
Fit
(
intf
);
}
}
}
void
VideoWindow
::
UpdateHide
(
wxEvent
&
_event
)
{
int
size_to_video
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
);
if
(
size_to_video
)
{
m_hide_timer
.
Start
(
1000
,
wxTIMER_ONE_SHOT
);
}
if
(
b_auto_size
)
m_hide_timer
.
Start
(
200
,
wxTIMER_ONE_SHOT
);
}
void
VideoWindow
::
OnHideTimer
(
wxTimerEvent
&
WXUNUSED
(
event
))
...
...
@@ -380,10 +335,8 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
{
case
VOUT_SET_ZOOM
:
{
i
nt
size_to_video
=
config_GetInt
(
p_intf
,
"wxwin-size-to-video"
)
;
i
f
(
!
b_auto_size
)
break
;
if
(
size_to_video
)
{
double
f_arg
=
va_arg
(
args
,
double
);
/* Update dimensions */
...
...
@@ -393,7 +346,6 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
AddPendingEvent
(
event
);
}
i_ret
=
VLC_SUCCESS
;
}
...
...
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