diff options
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 6702c3c9..d5501a0a 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -56,9 +56,22 @@ const char *atom_map[ATOM_LAST] = { "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", "_NET_WM_WINDOW_TYPE_POPUP_MENU", "_NET_WM_WINDOW_TYPE_COMBO", + "XdndSelection", + "XdndAware", + "XdndStatus", + "XdndPosition", + "XdndEnter", + "XdndLeave", + "XdndDrop", + "XdndFinished", + "XdndProxy", + "XdndTypeList", + "XdndActionMove", + "XdndActionCopy", + "XdndActionAsk", + "XdndActionPrivate", }; -/* General helpers */ // TODO: replace this with hash table? static struct wlr_xwayland_surface *lookup_surface(struct wlr_xwm *xwm, xcb_window_t window_id) { @@ -493,6 +506,26 @@ static void read_surface_net_wm_state(struct wlr_xwm *xwm, } } +char *xwm_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, @@ -525,7 +558,10 @@ 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 = xwm_get_atom_name(xwm, property); + wlr_log(L_DEBUG, "unhandled X11 property %u (%s) for window %u", + property, prop_name, xsurface->window_id); + free(prop_name); } free(reply); @@ -930,8 +966,11 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm, xwm_handle_net_wm_state_message(xwm, ev); } else if (ev->type == xwm->atoms[_NET_WM_MOVERESIZE]) { xwm_handle_net_wm_moveresize_message(xwm, ev); - } else { - wlr_log(L_DEBUG, "unhandled x11 client message %u", ev->type); + } else if (!xwm_handle_selection_client_message(xwm, ev)) { + char *type_name = xwm_get_atom_name(xwm, ev->type); + wlr_log(L_DEBUG, "unhandled x11 client message %u (%s)", ev->type, + type_name); + free(type_name); } } |