Implement _NET_WM_PING for X11 (#977)

This commit is contained in:
Ho-Yon Mak 2019-06-28 01:40:27 +01:00 committed by Hal Gentz
parent dd38fab2f3
commit 23354cf1a5
4 changed files with 18 additions and 2 deletions

View file

@ -131,6 +131,16 @@ impl<T: 'static> EventProcessor<T> {
window_id,
event: WindowEvent::CloseRequested,
});
} else if client_msg.data.get_long(0) as ffi::Atom == wt.net_wm_ping {
let response_msg: &mut ffi::XClientMessageEvent = xev.as_mut();
response_msg.window = wt.root;
wt.xconn
.send_event(
wt.root,
Some(ffi::SubstructureNotifyMask | ffi::SubstructureRedirectMask),
*response_msg,
)
.queue();
} else if client_msg.message_type == self.dnd.atoms.enter {
let source_window = client_msg.data.get_long(0) as c_ulong;
let flags = client_msg.data.get_long(1);