Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
0dec2f72
Commit
0dec2f72
authored
May 14, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XCB/window: implement --video-title,
UTF-8
names
parent
46fc1c8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
10 deletions
+46
-10
modules/video_output/xcb/window.c
modules/video_output/xcb/window.c
+46
-10
No files found.
modules/video_output/xcb/window.c
View file @
0dec2f72
...
...
@@ -78,12 +78,19 @@ struct vout_window_sys_t
/*xcb_atom_t wmstate_fullscreen;*/
};
static
inline
void
set_string
(
xcb_connection_t
*
conn
,
xcb_window_t
window
,
xcb_atom_t
type
,
xcb_atom_t
atom
,
const
char
*
str
)
{
xcb_change_property
(
conn
,
XCB_PROP_MODE_REPLACE
,
window
,
atom
,
type
,
/* format */
8
,
strlen
(
str
),
str
);
}
static
inline
void
set_ascii_prop
(
xcb_connection_t
*
conn
,
xcb_window_t
window
,
xcb_atom_t
atom
,
const
char
*
value
)
{
xcb_change_property
(
conn
,
XCB_PROP_MODE_REPLACE
,
window
,
atom
,
XA_STRING
,
8
,
strlen
(
value
),
value
);
set_string
(
conn
,
window
,
atom
,
XA_STRING
,
value
);
}
static
inline
...
...
@@ -98,6 +105,12 @@ void set_hostname_prop (xcb_connection_t *conn, xcb_window_t window)
}
}
static
inline
xcb_intern_atom_cookie_t
intern_string
(
xcb_connection_t
*
c
,
const
char
*
s
)
{
return
xcb_intern_atom
(
c
,
0
,
strlen
(
s
),
s
);
}
static
xcb_atom_t
get_atom
(
xcb_connection_t
*
conn
,
xcb_intern_atom_cookie_t
ck
)
{
...
...
@@ -179,6 +192,14 @@ static int Open (vlc_object_t *obj)
goto
error
;
}
wnd
->
handle
.
xid
=
window
;
wnd
->
p_sys
=
p_sys
;
wnd
->
control
=
Control
;
p_sys
->
conn
=
conn
;
p_sys
->
keys
=
CreateKeyHandler
(
obj
,
conn
);
p_sys
->
root
=
scr
->
root
;
/* ICCCM
* No cut&paste nor drag&drop, only Window Manager communication. */
/* Plain ASCII localization of VLC for ICCCM window name */
...
...
@@ -190,19 +211,34 @@ static int Open (vlc_object_t *obj)
XA_STRING
,
8
,
8
,
"vlc
\0
Vlc"
);
set_hostname_prop
(
conn
,
window
);
wnd
->
handle
.
xid
=
window
;
wnd
->
p_sys
=
p_sys
;
wnd
->
control
=
Control
;
/* EWMH */
xcb_intern_atom_cookie_t
utf8_string_ck
=
intern_string
(
conn
,
"UTF8_STRING"
);;
xcb_intern_atom_cookie_t
net_wm_name_ck
=
intern_string
(
conn
,
"_NET_WM_NAME"
);
xcb_intern_atom_cookie_t
net_wm_icon_name_ck
=
intern_string
(
conn
,
"_NET_WM_ICON_NAME"
);
p_sys
->
conn
=
conn
;
p_sys
->
keys
=
CreateKeyHandler
(
obj
,
conn
);
p_sys
->
root
=
scr
->
root
;
xcb_atom_t
utf8
=
get_atom
(
conn
,
utf8_string_ck
);
xcb_atom_t
net_wm_name
=
get_atom
(
conn
,
net_wm_name_ck
);
char
*
title
=
var_CreateGetNonEmptyString
(
wnd
,
"video-title"
);
if
(
title
)
{
set_string
(
conn
,
window
,
utf8
,
net_wm_name
,
title
);
free
(
title
);
}
else
set_string
(
conn
,
window
,
utf8
,
net_wm_name
,
_
(
"VLC media player"
));
xcb_atom_t
net_wm_icon_name
=
get_atom
(
conn
,
net_wm_icon_name_ck
);
set_string
(
conn
,
window
,
utf8
,
net_wm_icon_name
,
_
(
"VLC"
));
/* 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
,
19
,
"_NET_WM_STATE_ABOVE"
);
wm_state_ck
=
intern_string
(
conn
,
"_NET_WM_STATE"
);
wm_state_above_ck
=
intern_string
(
conn
,
"_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
);
...
...
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