From: malc Date: Sun, 10 Feb 2013 14:57:02 +0000 (+0400) Subject: Make use of _NET_WM_PID X-Git-Tag: v14~37 X-Git-Url: https://repo.or.cz/w/llpp.git/commitdiff_plain/6471a327b05b3030bc0c2c2aa4164dd1c9aa7d83 Make use of _NET_WM_PID Requested by Attila Toth. --- diff --git a/wsi.ml b/wsi.ml index f203b93..5095da4 100644 --- a/wsi.ml +++ b/wsi.ml @@ -729,6 +729,30 @@ let setup sock screennum w h = ); ); + sendintern sock "WM_CLIENT_MACHINE" false (fun resp -> + let atom = r32 resp 8 in + let empty = "" in + let hostname = + try Unix.gethostname () + with exn -> + dolog "error getting host name: %s" (exntos exn); + empty + in + if hostname == empty + then () + else ( + let s = changepropreq wid atom state.stringatom 8 hostname in + sendstr s sock; + sendintern sock "_NET_WM_PID" false (fun resp -> + let atom = r32 resp 8 in + let pid = Unix.getpid () in + let s = s32 pid in + let s = changepropreq wid atom 6 (* cardinal *) 8 s in + sendstr s sock; + ) + ) + ); + syncsendintern sock 2.0 "WM_CLASS" false (fun resp -> let atom = r32 resp 8 in let llpp = "llpp\000llpp\000" in