diff options
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 4fa7d311..c2b9bd11 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -51,12 +51,27 @@ const char *atom_map[ATOM_LAST] = { "INCR", "TEXT", "TIMESTAMP", + "DELETE", "_NET_WM_WINDOW_TYPE_UTILITY", "_NET_WM_WINDOW_TYPE_TOOLTIP", "_NET_WM_WINDOW_TYPE_DND", "_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", }; const char *wlr_xwayland_surface_role = "wlr_xwayland_surface"; @@ -71,7 +86,6 @@ struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface( return (struct wlr_xwayland_surface *)surface->role_data; } -/* General helpers */ // TODO: replace this with hash table? static struct wlr_xwayland_surface *lookup_surface(struct wlr_xwm *xwm, xcb_window_t window_id) { @@ -506,6 +520,21 @@ 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 = strndup(buf, len); + 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 +567,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); @@ -944,8 +976,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); } } @@ -1020,10 +1055,6 @@ static void xwm_handle_unhandled_event(struct wlr_xwm *xwm, xcb_generic_event_t #endif } -/* This is in xcb/xcb_event.h, but pulling xcb-util just for a constant - * others redefine anyway is meh - */ -#define XCB_EVENT_RESPONSE_TYPE_MASK (0x7f) static int x11_event_handler(int fd, uint32_t mask, void *data) { int count = 0; xcb_generic_event_t *event; |