Does this console entry tell you anything? It's occurring each time this happens:
14/06/2015 10:29:24.429 WindowServer[155]: CGError post_notification(const CGSNotificationType, void *const, const size_t, const bool, const CGSRealTimeDelta, const int, const CGSConnectionID *const, const...