window: Move can_ping to a function and implement in X11

!421
2 jobs for master in 3 minutes and 7 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #213905
build-mutter

00:01:10

 
  Test
passed #213906
test-mutter

00:01:56