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
39f4fd84
Commit
39f4fd84
authored
Apr 17, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement VOUT_SET_STAY_ON_TOP
parent
6e31246b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
modules/video_output/xcb/window.c
modules/video_output/xcb/window.c
+55
-0
No files found.
modules/video_output/xcb/window.c
View file @
39f4fd84
...
...
@@ -72,6 +72,11 @@ struct vout_window_sys_t
xcb_connection_t
*
conn
;
key_handler_t
*
keys
;
vlc_thread_t
thread
;
xcb_window_t
root
;
xcb_atom_t
wm_state
;
xcb_atom_t
wm_state_above
;
/*xcb_atom_t wmstate_fullscreen;*/
};
static
inline
...
...
@@ -94,6 +99,20 @@ void set_hostname_prop (xcb_connection_t *conn, xcb_window_t window)
}
}
static
xcb_atom_t
get_atom
(
xcb_connection_t
*
conn
,
xcb_intern_atom_cookie_t
ck
)
{
xcb_intern_atom_reply_t
*
reply
;
xcb_atom_t
atom
;
reply
=
xcb_intern_atom_reply
(
conn
,
ck
,
NULL
);
if
(
reply
==
NULL
)
return
0
;
atom
=
reply
->
atom
;
free
(
reply
);
return
atom
;
}
/**
* Create an X11 window.
...
...
@@ -156,7 +175,19 @@ static int Open (vlc_object_t *obj)
p_sys
->
conn
=
conn
;
p_sys
->
keys
=
CreateKeyHandler
(
obj
,
conn
);
p_sys
->
root
=
scr
->
root
;
/* Cache any EWMH atom we may need later */
xcb_intern_atom_cookie_t
wm_state_ck
,
wm_state_above_ck
;
wm_state_ck
=
xcb_intern_atom
(
conn
,
0
,
13
,
"_NET_WM_STATE"
);
wm_state_above_ck
=
xcb_intern_atom
(
conn
,
0
,
18
,
"_NET_WM_STATE_ABOVE"
);
p_sys
->
wm_state
=
get_atom
(
conn
,
wm_state_ck
);
p_sys
->
wm_state_above
=
get_atom
(
conn
,
wm_state_above_ck
);
/* Create the event thread. It will dequeue all events, so any checked
* request from this thread must be completed at this point. */
if
((
p_sys
->
keys
!=
NULL
)
&&
vlc_clone
(
&
p_sys
->
thread
,
Thread
,
wnd
,
VLC_THREAD_PRIORITY_LOW
))
DestroyKeyHandler
(
p_sys
->
keys
);
...
...
@@ -255,6 +286,30 @@ static int Control (vout_window_t *wnd, int cmd, va_list ap)
break
;
}
case
VOUT_SET_STAY_ON_TOP
:
{
/* From EWMH "_WM_STATE" */
xcb_client_message_event_t
ev
=
{
.
response_type
=
0x80
|
XCB_CLIENT_MESSAGE
,
.
format
=
32
,
.
window
=
wnd
->
handle
.
xid
,
.
type
=
p_sys
->
wm_state
,
};
bool
on
=
va_arg
(
ap
,
int
);
ev
.
data
.
data32
[
0
]
=
on
;
ev
.
data
.
data32
[
1
]
=
p_sys
->
wm_state_above
;
ev
.
data
.
data32
[
1
]
=
289
;
ev
.
data
.
data32
[
3
]
=
1
;
/* From ICCCM "Changing Window State" */
xcb_send_event
(
p_sys
->
conn
,
0
,
p_sys
->
root
,
XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
|
XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT
,
(
const
char
*
)
&
ev
);
xcb_flush
(
p_sys
->
conn
);
return
VLC_SUCCESS
;
}
default:
msg_Err
(
wnd
,
"request %d not implemented"
,
cmd
);
return
VLC_EGENERIC
;
...
...
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