diff options
author | emersion <contact@emersion.fr> | 2018-03-28 15:45:15 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-28 15:45:15 -0400 |
commit | bde859452db043f4b89a66d5d035af858cb22b64 (patch) | |
tree | 7d78242f8347ac7598594f4036994bb320860d57 /xwayland | |
parent | 2a34b154e683bb962aed354c1d980a7c10c66824 (diff) |
xwayland: print names of unsupported properties and client messages
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/xwm.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 712e1602..4b55769e 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -506,6 +506,26 @@ static void read_surface_net_wm_state(struct wlr_xwm *xwm, } } +static char *get_atom_name(struct wlr_xwm *xwm, xcb_atom_t atom) { + xcb_get_atom_name_cookie_t name_cookie = + xcb_get_atom_name(xwm->xcb_conn, atom); + xcb_get_atom_name_reply_t *name_reply = + xcb_get_atom_name_reply(xwm->xcb_conn, name_cookie, NULL); + if (name_reply == NULL) { + return NULL; + } + size_t len = xcb_get_atom_name_name_length(name_reply); + char *buf = xcb_get_atom_name_name(name_reply); // not a C string + char *name = malloc((len + 1) * sizeof(char)); + if (name == NULL) { + return NULL; + } + memcpy(name, buf, len); + name[len] = '\0'; + free(name_reply); + return name; +} + static void read_surface_property(struct wlr_xwm *xwm, struct wlr_xwayland_surface *xsurface, xcb_atom_t property) { xcb_get_property_cookie_t cookie = xcb_get_property(xwm->xcb_conn, 0, @@ -538,7 +558,9 @@ static void read_surface_property(struct wlr_xwm *xwm, } else if (property == xwm->atoms[MOTIF_WM_HINTS]) { read_surface_motif_hints(xwm, xsurface, reply); } else { - wlr_log(L_DEBUG, "unhandled x11 property %u", property); + char *prop_name = get_atom_name(xwm, property); + wlr_log(L_DEBUG, "unhandled x11 property %u (%s)", property, prop_name); + free(prop_name); } free(reply); @@ -944,7 +966,10 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm, } else if (ev->type == xwm->atoms[_NET_WM_MOVERESIZE]) { xwm_handle_net_wm_moveresize_message(xwm, ev); } else if (!xwm_handle_selection_client_message(xwm, ev)) { - wlr_log(L_DEBUG, "unhandled x11 client message %u", ev->type); + char *type_name = get_atom_name(xwm, ev->type); + wlr_log(L_DEBUG, "unhandled x11 client message %u (%s)", ev->type, + type_name); + free(type_name); } } |