summaryrefslogtreecommitdiff
path: root/src/event.c
blob: 8e527e44f462b348414cbc492fb8b4a619f4a8bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdlib.h>

#include <X11/Xproto.h>
#include <X11/Xlib.h>

#include "private.h"

WL_EXPORT int
XSendEvent(Display *xdisplay,
	   Window w, Bool propagate, long event_mask, XEvent* event_send)
{
	struct csx_display *display = csx_display(xdisplay);

	csx_display_enter(display, X_SendEvent, 0);

	STUB();

	return 1;
}

WL_EXPORT int
XAllowEvents(Display *xdisplay, int event_mode, Time time)
{
	struct csx_display *display = csx_display(xdisplay);

	csx_display_enter(display, X_AllowEvents, 0);

	STUB();

	return 1;
}

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;
}