// TODO The mir_event_ref is not supposed to be used but ... its needed // in this case. Need to wait until we can read from an FD set up by mir // for single threaded event handling. static EventNode* newEventNode(const MirEvent* event, _GLFWwindow* context) { EventNode* new_node = calloc(1, sizeof(EventNode)); new_node->event = mir_event_ref(event); new_node->window = context; return new_node; }
void _gdk_mir_event_source_queue (GdkMirWindowReference *window_ref, const MirEvent *event) { GdkMirEventSource *source = window_ref->source; GdkMirQueuedEvent *queued_event; /* We are in the wrong thread right now. We absolutely cannot touch * the window. * * We can do pretty much anything we want with the source, though... */ queued_event = g_slice_new (GdkMirQueuedEvent); g_atomic_int_inc (&window_ref->ref_count); queued_event->window_ref = window_ref; queued_event->event = mir_event_ref (event); g_mutex_lock (&source->mir_event_lock); g_queue_push_tail (&source->mir_events, queued_event); g_mutex_unlock (&source->mir_event_lock); g_main_context_wakeup (NULL); }
UbuntuEvent(QMirClientWindow* window, const MirEvent *event, QEvent::Type type) : QEvent(type), window(window) { nativeEvent = mir_event_ref(event); }