Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
87eb9dcd
Commit
87eb9dcd
authored
Mar 14, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/video_output/x11/*: fixed video resizing when using an external parent window.
parent
613d29c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
7 deletions
+36
-7
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.c
+34
-6
modules/video_output/x11/xcommon.h
modules/video_output/x11/xcommon.h
+2
-1
No files found.
modules/video_output/x11/xcommon.c
View file @
87eb9dcd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* Copyright (C) 1998-2001 VideoLAN
* $Id
: xcommon.c,v 1.42 2004/01/26 16:45:03 zorglub Exp
$
* $Id$
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Sam Hocevar <sam@zoy.org>
* Sam Hocevar <sam@zoy.org>
...
@@ -503,6 +503,31 @@ static int ManageVideo( vout_thread_t *p_vout )
...
@@ -503,6 +503,31 @@ static int ManageVideo( vout_thread_t *p_vout )
XEvent
xevent
;
/* X11 event */
XEvent
xevent
;
/* X11 event */
vlc_value_t
val
;
vlc_value_t
val
;
/* Handle events from the owner window */
if
(
p_vout
->
p_sys
->
p_win
->
owner_window
)
{
while
(
XCheckWindowEvent
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
p_win
->
owner_window
,
StructureNotifyMask
,
&
xevent
)
==
True
)
{
/* ConfigureNotify event: prepare */
if
(
xevent
.
type
==
ConfigureNotify
)
{
if
(
(
unsigned
int
)
xevent
.
xconfigure
.
width
!=
p_vout
->
p_sys
->
p_win
->
i_width
||
(
unsigned
int
)
xevent
.
xconfigure
.
height
!=
p_vout
->
p_sys
->
p_win
->
i_height
)
{
/* Update dimensions */
XResizeWindow
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
p_win
->
base_window
,
xevent
.
xconfigure
.
width
,
xevent
.
xconfigure
.
height
);
}
}
}
}
/* Handle X11 events: ConfigureNotify events are parsed to know if the
/* Handle X11 events: ConfigureNotify events are parsed to know if the
* output window's size changed, MapNotify and UnmapNotify to know if the
* output window's size changed, MapNotify and UnmapNotify to know if the
* window is mapped (and if the display is useful), and ClientMessages
* window is mapped (and if the display is useful), and ClientMessages
...
@@ -875,7 +900,6 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
...
@@ -875,7 +900,6 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
vlc_bool_t
b_map_notify
=
VLC_FALSE
;
vlc_bool_t
b_map_notify
=
VLC_FALSE
;
vlc_value_t
val
;
vlc_value_t
val
;
long
long
int
i_drawable
;
/* Prepare window manager hints and properties */
/* Prepare window manager hints and properties */
xsize_hints
.
base_width
=
p_win
->
i_width
;
xsize_hints
.
base_width
=
p_win
->
i_width
;
...
@@ -894,9 +918,9 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
...
@@ -894,9 +918,9 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
/* Check whether someone provided us with a window ID */
/* Check whether someone provided us with a window ID */
var_Get
(
p_vout
->
p_vlc
,
"drawable"
,
&
val
);
var_Get
(
p_vout
->
p_vlc
,
"drawable"
,
&
val
);
i_drawable
=
p_vout
->
b_fullscreen
?
0
:
val
.
i_int
;
p_win
->
owner_window
=
p_vout
->
b_fullscreen
?
0
:
val
.
i_int
;
if
(
!
i_drawable
)
if
(
!
p_win
->
owner_window
)
{
{
/* Create the window and set hints - the window must receive
/* Create the window and set hints - the window must receive
* ConfigureNotify events, and until it is displayed, Expose and
* ConfigureNotify events, and until it is displayed, Expose and
...
@@ -932,10 +956,14 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
...
@@ -932,10 +956,14 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
}
}
else
else
{
{
/* Select events we are interested in. */
XSelectInput
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
,
StructureNotifyMask
);
/* Get the parent window's geometry information */
/* Get the parent window's geometry information */
Window
dummy1
;
Window
dummy1
;
unsigned
int
dummy2
,
dummy3
;
unsigned
int
dummy2
,
dummy3
;
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
i_drawable
,
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
,
&
dummy1
,
&
dummy2
,
&
dummy3
,
&
dummy1
,
&
dummy2
,
&
dummy3
,
&
p_win
->
i_width
,
&
p_win
->
i_width
,
&
p_win
->
i_height
,
&
p_win
->
i_height
,
...
@@ -948,7 +976,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
...
@@ -948,7 +976,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
* ButtonPress event, so we need to open a new window anyway. */
* ButtonPress event, so we need to open a new window anyway. */
p_win
->
base_window
=
p_win
->
base_window
=
XCreateWindow
(
p_vout
->
p_sys
->
p_display
,
XCreateWindow
(
p_vout
->
p_sys
->
p_display
,
i_drawable
,
p_win
->
owner_window
,
0
,
0
,
0
,
0
,
p_win
->
i_width
,
p_win
->
i_height
,
p_win
->
i_width
,
p_win
->
i_height
,
0
,
0
,
...
...
modules/video_output/x11/xcommon.h
View file @
87eb9dcd
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* xcommon.h: Defines common to the X11 and XVideo plugins
* xcommon.h: Defines common to the X11 and XVideo plugins
*****************************************************************************
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* Copyright (C) 1998-2001 VideoLAN
* $Id
: xcommon.h,v 1.10 2003/10/25 00:49:14 sam Exp
$
* $Id$
*
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Samuel Hocevar <sam@zoy.org>
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
*****************************************************************************/
*****************************************************************************/
typedef
struct
x11_window_t
typedef
struct
x11_window_t
{
{
Window
owner_window
;
/* owner window (if any) */
Window
base_window
;
/* base window */
Window
base_window
;
/* base window */
Window
video_window
;
/* sub-window for displaying video */
Window
video_window
;
/* sub-window for displaying video */
GC
gc
;
/* graphic context instance handler */
GC
gc
;
/* graphic context instance handler */
...
...
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