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
2a1bc0ad
Commit
2a1bc0ad
authored
May 13, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xlib: assume we have a window provider
parent
d73948b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
63 deletions
+26
-63
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.c
+26
-63
No files found.
modules/video_output/x11/xcommon.c
View file @
2a1bc0ad
...
...
@@ -1611,6 +1611,8 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
{
p_win
->
owner_window
=
vout_RequestXWindow
(
p_vout
,
&
p_win
->
i_x
,
&
p_win
->
i_y
,
&
p_win
->
i_width
,
&
p_win
->
i_height
);
if
(
!
p_win
->
owner_window
)
return
VLC_EGENERIC
;
xsize_hints
.
base_width
=
xsize_hints
.
width
=
p_win
->
i_width
;
xsize_hints
.
base_height
=
xsize_hints
.
height
=
p_win
->
i_height
;
xsize_hints
.
flags
=
PSize
|
PMinSize
;
...
...
@@ -1621,6 +1623,30 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
xsize_hints
.
y
=
p_win
->
i_y
;
xsize_hints
.
flags
|=
PPosition
;
}
/* Select events we are interested in. */
XSelectInput
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
StructureNotifyMask
);
/* Get the parent window's geometry information */
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
&
(
Window
){
0
},
&
(
int
){
0
},
&
(
int
){
0
},
&
p_win
->
i_width
,
&
p_win
->
i_height
,
&
(
unsigned
){
0
},
&
(
unsigned
){
0
}
);
/* From man XSelectInput: only one client at a time can select a
* ButtonPress event, so we need to open a new window anyway. */
p_win
->
base_window
=
XCreateWindow
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
0
,
0
,
p_win
->
i_width
,
p_win
->
i_height
,
0
,
0
,
CopyFromParent
,
0
,
CWBackingStore
|
CWBackPixel
|
CWEventMask
,
&
xwindow_attributes
);
}
else
{
...
...
@@ -1631,10 +1657,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
DisplayWidth
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
i_screen
);
p_win
->
i_height
=
DisplayHeight
(
p_vout
->
p_sys
->
p_display
,
p_vout
->
p_sys
->
i_screen
);
}
if
(
!
p_win
->
owner_window
)
{
/* Create the window and set hints - the window must receive
* ConfigureNotify events, and until it is displayed, Expose and
* MapNotify events. */
...
...
@@ -1668,66 +1691,6 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
p_win
->
base_window
,
val
.
psz_string
);
}
free
(
val
.
psz_string
);
if
(
!
p_vout
->
b_fullscreen
)
{
const
char
*
argv
[]
=
{
"vlc"
,
NULL
};
/* Set window manager hints and properties: size hints, command,
* window's name, and accepted protocols */
XSetWMNormalHints
(
p_vout
->
p_sys
->
p_display
,
p_win
->
base_window
,
&
xsize_hints
);
XSetCommand
(
p_vout
->
p_sys
->
p_display
,
p_win
->
base_window
,
(
char
**
)
argv
,
1
);
if
(
!
var_GetBool
(
p_vout
,
"video-deco"
)
)
{
Atom
prop
;
mwmhints_t
mwmhints
;
mwmhints
.
flags
=
MWM_HINTS_DECORATIONS
;
mwmhints
.
decorations
=
False
;
prop
=
XInternAtom
(
p_vout
->
p_sys
->
p_display
,
"_MOTIF_WM_HINTS"
,
False
);
XChangeProperty
(
p_vout
->
p_sys
->
p_display
,
p_win
->
base_window
,
prop
,
prop
,
32
,
PropModeReplace
,
(
unsigned
char
*
)
&
mwmhints
,
PROP_MWM_HINTS_ELEMENTS
);
}
}
}
else
{
Window
dummy1
;
int
dummy2
,
dummy3
;
unsigned
int
dummy4
,
dummy5
;
/* Select events we are interested in. */
XSelectInput
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
StructureNotifyMask
);
/* Get the parent window's geometry information */
XGetGeometry
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
&
dummy1
,
&
dummy2
,
&
dummy3
,
&
p_win
->
i_width
,
&
p_win
->
i_height
,
&
dummy4
,
&
dummy5
);
/* From man XSelectInput: only one client at a time can select a
* ButtonPress event, so we need to open a new window anyway. */
p_win
->
base_window
=
XCreateWindow
(
p_vout
->
p_sys
->
p_display
,
p_win
->
owner_window
->
handle
.
xid
,
0
,
0
,
p_win
->
i_width
,
p_win
->
i_height
,
0
,
0
,
CopyFromParent
,
0
,
CWBackingStore
|
CWBackPixel
|
CWEventMask
,
&
xwindow_attributes
);
}
if
(
(
p_win
->
wm_protocols
==
None
)
/* use WM_DELETE_WINDOW */
...
...
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