xstate: Set WM_S0 atom at startup

Xwayland waits for this before starting to listen on the -listenfd descriptors
if either -wm or -initfd is set.

- https://gitlab.freedesktop.org/xorg/xserver/-/blob/xwayland-24.1.6/hw/xwayland/xwayland.c?ref_type=tags#L463-472
- https://gitlab.freedesktop.org/xorg/xserver/-/blob/xwayland-24.1.6/hw/xwayland/xwayland.c?ref_type=tags#L300-317
This commit is contained in:
Ivan Molodetskikh 2025-06-03 17:40:35 +03:00 committed by Supreeeme
parent 3ba30b149f
commit ac391db415

View file

@ -294,6 +294,14 @@ impl XState {
data: b"xwayland-satellite", data: b"xwayland-satellite",
}) })
.unwrap(); .unwrap();
self.connection
.send_and_check_request(&x::SetSelectionOwner {
owner: self.wm_window,
selection: self.atoms.wm_s0,
time: x::CURRENT_TIME,
})
.unwrap();
} }
pub fn handle_events(&mut self, server_state: &mut super::RealServerState) { pub fn handle_events(&mut self, server_state: &mut super::RealServerState) {
@ -886,6 +894,7 @@ xcb::atoms_struct! {
wm_delete_window => b"WM_DELETE_WINDOW" only_if_exists = false, wm_delete_window => b"WM_DELETE_WINDOW" only_if_exists = false,
wm_transient_for => b"WM_TRANSIENT_FOR" only_if_exists = false, wm_transient_for => b"WM_TRANSIENT_FOR" only_if_exists = false,
wm_state => b"WM_STATE" only_if_exists = false, wm_state => b"WM_STATE" only_if_exists = false,
wm_s0 => b"WM_S0" only_if_exists = false,
wm_check => b"_NET_SUPPORTING_WM_CHECK" only_if_exists = false, wm_check => b"_NET_SUPPORTING_WM_CHECK" only_if_exists = false,
net_wm_name => b"_NET_WM_NAME" only_if_exists = false, net_wm_name => b"_NET_WM_NAME" only_if_exists = false,
wm_pid => b"_NET_WM_PID" only_if_exists = false, wm_pid => b"_NET_WM_PID" only_if_exists = false,