summaryrefslogtreecommitdiff
path: root/src/event.c
blob: d997990af15c9f1d0d73bdd309a559a658ac4d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdlib.h>

#include "Xlib-wayland.h"

#include "private.h"

WL_EXPORT int
XNextEvent(Display *xdisplay, XEvent *xevent)
{
	struct csx_display *display = csx_display(xdisplay);
	struct csx_event *event;

	while (wl_list_empty(&display->event_list))
		wl_display_dispatch(display->display);

	event = container_of(display->event_list.next, struct csx_event, link);
	wl_list_remove(&event->link);
	*xevent = event->xevent;
	free(event);

	return 0;
}