xwayland: don't ping if client not supports

Signed-off-by: xurui <xurui@kylinos.cn>
This commit is contained in:
xurui 2025-07-04 15:46:06 +08:00
parent 31b78a4f3a
commit 18c707d90a

View file

@ -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;