diff --git a/xwayland/xwm.c b/xwayland/xwm.c index a82e8b145..9ee6390db 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -2745,6 +2745,22 @@ bool xwm_atoms_contains(struct wlr_xwm *xwm, xcb_atom_t *atoms, } void wlr_xwayland_surface_ping(struct wlr_xwayland_surface *surface) { + if (surface->pinging) { + return; + } + + // don't ping if client not supports + bool supports_ping = false; + for(size_t i = 0; i < surface->protocols_len; i++) { + if (surface->protocols[i] == surface->xwm->atoms[NET_WM_PING]) { + supports_ping = true; + break; + } + } + if (!supports_ping) { + return; + } + xcb_client_message_data_t data = { 0 }; data.data32[0] = surface->xwm->atoms[NET_WM_PING]; data.data32[1] = XCB_CURRENT_TIME;