events: Protect against error from XGetWMHints()

2 jobs for master in 2 minutes and 48 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #8651
build

00:01:04

 
  Distcheck
passed #8652
distcheck

00:01:43