mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 09:08:33 +02:00
xwm: Check result of xcb_get_atom_name_reply
When printing debug information about atoms, the XWM would crash if the X server failed to respond to a request about atom names. In practice this occurred when the server itself crashed, e.g. when starting mplayer with the "xv" vo.
This commit is contained in:
parent
3170012ec5
commit
55375b9858
1 changed files with 9 additions and 3 deletions
|
|
@ -137,9 +137,15 @@ get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
|
|||
|
||||
cookie = xcb_get_atom_name (c, atom);
|
||||
reply = xcb_get_atom_name_reply (c, cookie, &e);
|
||||
snprintf(buffer, sizeof buffer, "%.*s",
|
||||
xcb_get_atom_name_name_length (reply),
|
||||
xcb_get_atom_name_name (reply));
|
||||
|
||||
if(reply) {
|
||||
snprintf(buffer, sizeof buffer, "%.*s",
|
||||
xcb_get_atom_name_name_length (reply),
|
||||
xcb_get_atom_name_name (reply));
|
||||
} else {
|
||||
snprintf(buffer, sizeof buffer, "(atom %u)", atom);
|
||||
}
|
||||
|
||||
free(reply);
|
||||
|
||||
return buffer;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue