summaryrefslogtreecommitdiff
path: root/src/wfdevent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wfdevent.c')
-rw-r--r--src/wfdevent.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/wfdevent.c b/src/wfdevent.c
index 5d0afc5..e7cb165 100644
--- a/src/wfdevent.c
+++ b/src/wfdevent.c
@@ -29,6 +29,7 @@
#include <WF/wfd.h>
#include <WF/wfdext.h>
+#include "wflist.h"
#include "wfdregistry.h"
#include "wfdevent.h"
#include "wfdport.h"
@@ -42,12 +43,11 @@
#include <sys/time.h>
#include <unistd.h>
-#include <glib.h>
-
-
struct bind_event {
WFDint pipeline_id;
WFDint time;
+
+ struct wf_list link;
};
struct wfd_event {
@@ -67,7 +67,7 @@ struct wfd_event {
WFDboolean attach_state;
int source_bind_event_queue_fd;
- GQueue *bind_event_queue;
+ struct wf_list bind_event_queue;
WFDEventType current_event_type;
};
@@ -76,7 +76,6 @@ void
wfd_event_destroy(struct wfd_device *device,
struct wfd_event *event)
{
- g_queue_free(event->bind_event_queue);
close(event->drm_fd);
udev_monitor_unref(event->udev_monitor);
close(event->epoll_fd);
@@ -178,7 +177,7 @@ wfd_create_event(struct wfd_device *device,
return NULL;
}
- event->bind_event_queue = g_queue_new();
+ wf_list_init(&event->bind_event_queue);
event->device = device;
event->current_event_type = WFD_EVENT_NONE;
@@ -268,8 +267,8 @@ page_flip_handler(int fd, unsigned int frame,
if (queue_entry) {
*queue_entry = bind;
- g_queue_push_tail(global_event->bind_event_queue,
- queue_entry);
+ wf_list_push_tail(&global_event->bind_event_queue,
+ queue_entry, link);
write(global_event->source_bind_event_queue_fd,
&add, sizeof add);
@@ -327,7 +326,9 @@ wfd_event_wait(struct wfd_device *device,
read(event->source_bind_event_queue_fd, &id, sizeof id);
- queue_entry = g_queue_pop_head(event->bind_event_queue);
+ wf_list_pop_head(&event->bind_event_queue,
+ queue_entry, link);
+
event->bind = *queue_entry;
free(queue_entry);
event_type = WFD_EVENT_PIPELINE_BIND_SOURCE_COMPLETE;