general cleanup for xwl and wrap capture_mouse in guards