/* Call window's event handler, if one is set. 
This function is a small helper function that checks if a window has an event handler at all, and in that case, sends it an event for handling. If an event handler is present, and accepts the event, this function returns true. If the event handler rejects it, or there's no event handler present, this function returns false. */
static bool win_handle_event(struct win_window *win, enum win_event_type type, const void *data)
/* Call window's event handler, if one is set. 
This function is a small helper function that checks if a window has an event handler at all, and in that case, sends it an event for handling. If an event handler is present, and accepts the event, this function returns true. If the event handler rejects it, or there's no event handler present, this function returns false. */
static bool win_handle_event(struct win_window *win, enum win_event_type type, const void *data)
{
	win_event_handler_t handler = win->attributes.event_handler;
	if (handler) {
		return handler(win, type, data);
	} else {
		return false;
	}
}