1 /* Copyright (C) <2018, 2019, 2020> Philippe Normand <philn@igalia.com>
2 * Copyright (C) <2018> Žan Doberšek <zdobersek@igalia.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
24 #include "WPEThreadedView.h"
26 #include "gstwpesrcbin.h"
28 #include <gst/gl/gl.h>
29 #include <gst/gl/egl/gsteglimage.h>
30 #include <gst/gl/egl/gstgldisplay_egl.h>
31 #include <wayland-server.h>
36 #if ENABLE_SHM_BUFFER_SUPPORT
37 #include <wpe/unstable/fdo-shm.h>
40 GST_DEBUG_CATEGORY_EXTERN (wpe_view_debug);
41 #define GST_CAT_DEFAULT wpe_view_debug
43 #if defined(WPE_FDO_CHECK_VERSION) && WPE_FDO_CHECK_VERSION(1, 3, 0)
44 #define USE_DEPRECATED_FDO_EGL_IMAGE 0
45 #define WPE_GLIB_SOURCE_PRIORITY G_PRIORITY_DEFAULT
47 #define USE_DEPRECATED_FDO_EGL_IMAGE 1
48 #define WPE_GLIB_SOURCE_PRIORITY -70
53 GMutexHolder(GMutex& mutex)
67 static WPEContextThread *s_view = NULL;
69 WPEContextThread& WPEContextThread::singleton()
71 static gsize initialized = 0;
73 if (g_once_init_enter (&initialized)) {
74 s_view = new WPEContextThread;
76 g_once_init_leave (&initialized, 1);
82 WPEContextThread::WPEContextThread()
84 g_mutex_init(&threading.mutex);
85 g_cond_init(&threading.cond);
88 GMutexHolder lock(threading.mutex);
89 threading.thread = g_thread_new("WPEContextThread", s_viewThread, this);
90 g_cond_wait(&threading.cond, &threading.mutex);
91 GST_DEBUG("thread spawned");
95 WPEContextThread::~WPEContextThread()
97 if (threading.thread) {
98 g_thread_unref(threading.thread);
99 threading.thread = nullptr;
102 g_mutex_clear(&threading.mutex);
103 g_cond_clear(&threading.cond);
106 template<typename Function>
107 void WPEContextThread::dispatch(Function func)
112 struct Payload payload { func };
114 GSource* source = g_idle_source_new();
115 g_source_set_callback(source, [](gpointer data) -> gboolean {
116 auto& view = WPEContextThread::singleton();
117 GMutexHolder lock(view.threading.mutex);
119 auto* payload = static_cast<struct Payload*>(data);
122 g_cond_signal(&view.threading.cond);
123 return G_SOURCE_REMOVE;
124 }, &payload, nullptr);
125 g_source_set_priority(source, WPE_GLIB_SOURCE_PRIORITY);
128 GMutexHolder lock(threading.mutex);
129 g_source_attach(source, glib.context);
130 g_cond_wait(&threading.cond, &threading.mutex);
133 g_source_unref(source);
136 gpointer WPEContextThread::s_viewThread(gpointer data)
138 auto& view = *static_cast<WPEContextThread*>(data);
140 view.glib.context = g_main_context_new();
141 view.glib.loop = g_main_loop_new(view.glib.context, FALSE);
143 g_main_context_push_thread_default(view.glib.context);
146 GSource* source = g_idle_source_new();
147 g_source_set_callback(source,
148 [](gpointer data) -> gboolean {
149 auto& view = *static_cast<WPEContextThread*>(data);
150 GMutexHolder lock(view.threading.mutex);
151 g_cond_signal(&view.threading.cond);
152 return G_SOURCE_REMOVE;
155 g_source_attach(source, view.glib.context);
156 g_source_unref(source);
159 g_main_loop_run(view.glib.loop);
161 g_main_loop_unref(view.glib.loop);
162 view.glib.loop = nullptr;
164 g_main_context_pop_thread_default(view.glib.context);
165 g_main_context_unref(view.glib.context);
166 view.glib.context = nullptr;
172 initialize_web_extensions (WebKitWebContext *context)
174 webkit_web_context_set_web_extensions_directory (context, gst_wpe_get_extension_path ());
178 webkit_extension_msg_received (WebKitWebContext *context,
179 WebKitUserMessage *message,
182 const gchar *name = webkit_user_message_get_name (message);
183 GVariant *params = webkit_user_message_get_parameters (message);
186 if (!g_strcmp0(name, "gstwpe.new_stream")) {
187 guint32 id = g_variant_get_uint32 (g_variant_get_child_value (params, 0));
188 const gchar *capsstr = g_variant_get_string (g_variant_get_child_value (params, 1), NULL);
189 GstCaps *caps = gst_caps_from_string (capsstr);
190 const gchar *stream_id = g_variant_get_string (g_variant_get_child_value (params, 2), NULL);
191 gst_wpe_src_new_audio_stream(src, id, caps, stream_id);
192 gst_caps_unref (caps);
193 } else if (!g_strcmp0(name, "gstwpe.set_shm")) {
194 auto fdlist = webkit_user_message_get_fd_list (message);
195 gint id = g_variant_get_uint32 (g_variant_get_child_value (params, 0));
196 gst_wpe_src_set_audio_shm (src, fdlist, id);
197 } else if (!g_strcmp0(name, "gstwpe.new_buffer")) {
198 guint32 id = g_variant_get_uint32 (g_variant_get_child_value (params, 0));
199 guint64 size = g_variant_get_uint64 (g_variant_get_child_value (params, 1));
200 gst_wpe_src_push_audio_buffer (src, id, size);
202 webkit_user_message_send_reply(message, webkit_user_message_new ("gstwpe.buffer_processed", NULL));
203 } else if (!g_strcmp0(name, "gstwpe.pause")) {
204 guint32 id = g_variant_get_uint32 (params);
206 gst_wpe_src_pause_audio_stream (src, id);
207 } else if (!g_strcmp0(name, "gstwpe.stop")) {
208 guint32 id = g_variant_get_uint32 (params);
210 gst_wpe_src_stop_audio_stream (src, id);
213 g_error("Unknown event: %s", name);
220 WPEView* WPEContextThread::createWPEView(GstWpeVideoSrc* src, GstGLContext* context, GstGLDisplay* display, int width, int height)
222 GST_DEBUG("context %p display %p, size (%d,%d)", context, display, width, height);
224 static std::once_flag s_loaderFlag;
225 std::call_once(s_loaderFlag,
227 #if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 2, 0)
228 wpe_loader_init("libWPEBackend-fdo-1.0.so");
232 WPEView* view = nullptr;
233 dispatch([&]() mutable {
234 auto* manager = webkit_website_data_manager_new_ephemeral();
235 auto web_context = webkit_web_context_new_with_website_data_manager(manager);
236 g_object_unref(manager);
238 view = new WPEView(web_context, src, context, display, width, height);
241 if (view && view->hasUri()) {
242 GST_DEBUG("waiting load to finish");
243 view->waitLoadCompletion();
250 static gboolean s_loadFailed(WebKitWebView*, WebKitLoadEvent, gchar* failing_uri, GError* error, gpointer data)
252 GstWpeVideoSrc* src = GST_WPE_VIDEO_SRC(data);
254 if (g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) {
255 GST_INFO_OBJECT (src, "Loading cancelled.");
260 GST_ELEMENT_ERROR (GST_ELEMENT_CAST(src), RESOURCE, FAILED, (NULL), ("Failed to load %s (%s)", failing_uri, error->message));
264 static gboolean s_loadFailedWithTLSErrors(WebKitWebView*, gchar* failing_uri, GTlsCertificate*, GTlsCertificateFlags, gpointer data)
266 // Defer to load-failed.
270 static void s_loadProgressChaned(GObject* object, GParamSpec*, gpointer data)
272 GstElement* src = GST_ELEMENT_CAST (data);
273 // The src element is locked already so we can't call
274 // gst_element_post_message(). Instead retrieve the bus manually and use it
276 GstBus* bus = GST_ELEMENT_BUS (src);
277 double estimatedProgress;
278 g_object_get(object, "estimated-load-progress", &estimatedProgress, nullptr);
279 gst_object_ref (bus);
280 gst_bus_post (bus, gst_message_new_element(GST_OBJECT_CAST(src), gst_structure_new("wpe-stats", "estimated-load-progress", G_TYPE_DOUBLE, estimatedProgress * 100, nullptr)));
281 gst_object_unref (bus);
284 WPEView::WPEView(WebKitWebContext* web_context, GstWpeVideoSrc* src, GstGLContext* context, GstGLDisplay* display, int width, int height)
288 GstObject *parent = gst_object_get_parent (GST_OBJECT (src));
290 if (parent && GST_IS_WPE_SRC (parent)) {
291 audio.init_ext_sigid = g_signal_connect (web_context,
292 "initialize-web-extensions",
293 G_CALLBACK (initialize_web_extensions),
295 audio.extension_msg_sigid = g_signal_connect (web_context,
296 "user-message-received",
297 G_CALLBACK (webkit_extension_msg_received),
299 GST_INFO_OBJECT (parent, "Enabled audio");
302 gst_clear_object (&parent);
306 g_mutex_init(&threading.ready_mutex);
307 g_cond_init(&threading.ready_cond);
308 threading.ready = FALSE;
310 g_mutex_init(&images_mutex);
312 gst.context = GST_GL_CONTEXT(gst_object_ref(context));
314 gst.display = GST_GL_DISPLAY(gst_object_ref(display));
320 if (context && display) {
321 if (gst_gl_context_get_gl_platform(context) == GST_GL_PLATFORM_EGL) {
322 gst.display_egl = gst_gl_display_egl_from_gl_display (gst.display);
324 GST_DEBUG ("Available GStreamer GL Context is not EGL - not creating an EGL display from it");
328 if (gst.display_egl) {
329 EGLDisplay eglDisplay = (EGLDisplay)gst_gl_display_get_handle (GST_GL_DISPLAY(gst.display_egl));
330 GST_DEBUG("eglDisplay %p", eglDisplay);
332 m_isValid = wpe_fdo_initialize_for_egl_display(eglDisplay);
333 GST_DEBUG("FDO EGL display initialisation result: %d", m_isValid);
335 #if ENABLE_SHM_BUFFER_SUPPORT
336 m_isValid = wpe_fdo_initialize_shm();
337 GST_DEBUG("FDO SHM initialisation result: %d", m_isValid);
339 GST_WARNING("FDO SHM support is available only in WPEBackend-FDO 1.7.0");
345 if (gst.display_egl) {
346 wpe.exportable = wpe_view_backend_exportable_fdo_egl_create(&s_exportableEGLClient, this, wpe.width, wpe.height);
348 #if ENABLE_SHM_BUFFER_SUPPORT
349 wpe.exportable = wpe_view_backend_exportable_fdo_create(&s_exportableClient, this, wpe.width, wpe.height);
353 auto* wpeViewBackend = wpe_view_backend_exportable_fdo_get_view_backend(wpe.exportable);
354 auto* viewBackend = webkit_web_view_backend_new(wpeViewBackend, (GDestroyNotify) wpe_view_backend_exportable_fdo_destroy, wpe.exportable);
355 #if defined(WPE_BACKEND_CHECK_VERSION) && WPE_BACKEND_CHECK_VERSION(1, 1, 0)
356 wpe_view_backend_add_activity_state(wpeViewBackend, wpe_view_activity_state_visible | wpe_view_activity_state_focused | wpe_view_activity_state_in_window);
359 webkit.view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
360 "web-context", web_context,
361 "backend", viewBackend,
364 g_signal_connect(webkit.view, "load-failed", G_CALLBACK(s_loadFailed), src);
365 g_signal_connect(webkit.view, "load-failed-with-tls-errors", G_CALLBACK(s_loadFailedWithTLSErrors), src);
366 g_signal_connect(webkit.view, "notify::estimated-load-progress", G_CALLBACK(s_loadProgressChaned), src);
368 auto* settings = webkit_web_view_get_settings(webkit.view);
369 webkit_settings_set_enable_webaudio(settings, TRUE);
371 gst_wpe_video_src_configure_web_view(src, webkit.view);
374 gboolean drawBackground = TRUE;
375 g_object_get(src, "location", &location, "draw-background", &drawBackground, nullptr);
376 setDrawBackground(drawBackground);
378 loadUriUnlocked(location);
385 GstEGLImage *egl_pending = NULL;
386 GstEGLImage *egl_committed = NULL;
387 GstBuffer *shm_pending = NULL;
388 GstBuffer *shm_committed = NULL;
389 GST_TRACE ("%p destroying", this);
391 g_mutex_clear(&threading.ready_mutex);
392 g_cond_clear(&threading.ready_cond);
395 GMutexHolder lock(images_mutex);
398 egl_pending = egl.pending;
399 egl.pending = nullptr;
402 egl_committed = egl.committed;
403 egl.committed = nullptr;
406 GST_TRACE ("%p freeing shm pending %" GST_PTR_FORMAT, this, shm.pending);
407 shm_pending = shm.pending;
408 shm.pending = nullptr;
411 GST_TRACE ("%p freeing shm commited %" GST_PTR_FORMAT, this, shm.committed);
412 shm_committed = shm.committed;
413 shm.committed = nullptr;
418 gst_egl_image_unref (egl_pending);
420 gst_egl_image_unref (egl_committed);
422 gst_buffer_unref (shm_pending);
424 gst_buffer_unref (shm_committed);
426 if (audio.init_ext_sigid) {
427 WebKitWebContext* web_context = webkit_web_view_get_context (webkit.view);
429 g_signal_handler_disconnect(web_context, audio.init_ext_sigid);
430 g_signal_handler_disconnect(web_context, audio.extension_msg_sigid);
431 audio.init_ext_sigid = 0;
432 audio.extension_msg_sigid = 0;
435 WPEContextThread::singleton().dispatch([&]() {
437 g_object_unref(webkit.view);
438 webkit.view = nullptr;
442 if (gst.display_egl) {
443 gst_object_unref(gst.display_egl);
444 gst.display_egl = nullptr;
448 gst_object_unref(gst.display);
449 gst.display = nullptr;
453 gst_object_unref(gst.context);
454 gst.context = nullptr;
458 webkit.uri = nullptr;
461 g_mutex_clear(&images_mutex);
462 GST_TRACE ("%p destroyed", this);
465 void WPEView::notifyLoadFinished()
467 GMutexHolder lock(threading.ready_mutex);
468 if (!threading.ready) {
469 threading.ready = TRUE;
470 g_cond_signal(&threading.ready_cond);
474 void WPEView::waitLoadCompletion()
476 GMutexHolder lock(threading.ready_mutex);
477 while (!threading.ready)
478 g_cond_wait(&threading.ready_cond, &threading.ready_mutex);
481 GstEGLImage* WPEView::image()
483 GstEGLImage* ret = nullptr;
484 bool dispatchFrameComplete = false;
485 GstEGLImage *prev_image = NULL;
488 GMutexHolder lock(images_mutex);
490 GST_TRACE("pending %" GST_PTR_FORMAT " (%d) committed %" GST_PTR_FORMAT " (%d)", egl.pending,
491 GST_IS_EGL_IMAGE(egl.pending) ? GST_MINI_OBJECT_REFCOUNT_VALUE(GST_MINI_OBJECT_CAST(egl.pending)) : 0,
493 GST_IS_EGL_IMAGE(egl.committed) ? GST_MINI_OBJECT_REFCOUNT_VALUE(GST_MINI_OBJECT_CAST(egl.committed)) : 0);
496 prev_image = egl.committed;
497 egl.committed = egl.pending;
498 egl.pending = nullptr;
500 dispatchFrameComplete = true;
508 gst_egl_image_unref(prev_image);
510 if (dispatchFrameComplete)
516 GstBuffer* WPEView::buffer()
518 GstBuffer* ret = nullptr;
519 bool dispatchFrameComplete = false;
520 GstBuffer *prev_image = NULL;
523 GMutexHolder lock(images_mutex);
525 GST_TRACE("pending %" GST_PTR_FORMAT " (%d) committed %" GST_PTR_FORMAT " (%d)", shm.pending,
526 GST_IS_BUFFER(shm.pending) ? GST_MINI_OBJECT_REFCOUNT_VALUE(GST_MINI_OBJECT_CAST(shm.pending)) : 0,
528 GST_IS_BUFFER(shm.committed) ? GST_MINI_OBJECT_REFCOUNT_VALUE(GST_MINI_OBJECT_CAST(shm.committed)) : 0);
531 prev_image = shm.committed;
532 shm.committed = shm.pending;
533 shm.pending = nullptr;
535 dispatchFrameComplete = true;
543 gst_buffer_unref(prev_image);
545 if (dispatchFrameComplete)
551 void WPEView::resize(int width, int height)
553 GST_DEBUG("resize to %dx%d", width, height);
557 s_view->dispatch([&]() {
558 if (wpe.exportable && wpe_view_backend_exportable_fdo_get_view_backend(wpe.exportable))
559 wpe_view_backend_dispatch_set_size(wpe_view_backend_exportable_fdo_get_view_backend(wpe.exportable), wpe.width, wpe.height);
563 void WPEView::frameComplete()
565 GST_TRACE("frame complete");
566 s_view->dispatch([&]() {
567 GST_TRACE("dispatching");
568 wpe_view_backend_exportable_fdo_dispatch_frame_complete(wpe.exportable);
572 void WPEView::loadUriUnlocked(const gchar* uri)
577 GST_DEBUG("loading %s", uri);
578 webkit.uri = g_strdup(uri);
579 webkit_web_view_load_uri(webkit.view, webkit.uri);
582 void WPEView::loadUri(const gchar* uri)
584 s_view->dispatch([&]() {
585 loadUriUnlocked(uri);
589 void WPEView::loadData(GBytes* bytes)
591 s_view->dispatch([this, bytes = g_bytes_ref(bytes)]() {
592 webkit_web_view_load_bytes(webkit.view, bytes, nullptr, nullptr, nullptr);
593 g_bytes_unref(bytes);
597 void WPEView::setDrawBackground(gboolean drawsBackground)
599 GST_DEBUG("%s background rendering", drawsBackground ? "Enabling" : "Disabling");
601 webkit_color_parse(&color, drawsBackground ? "white" : "transparent");
602 webkit_web_view_set_background_color(webkit.view, &color);
605 void WPEView::releaseImage(gpointer imagePointer)
607 s_view->dispatch([&]() {
608 GST_TRACE("Dispatch release exported image %p", imagePointer);
609 #if USE_DEPRECATED_FDO_EGL_IMAGE
610 wpe_view_backend_exportable_fdo_egl_dispatch_release_image(wpe.exportable,
611 static_cast<EGLImageKHR>(imagePointer));
613 wpe_view_backend_exportable_fdo_egl_dispatch_release_exported_image(wpe.exportable,
614 static_cast<struct wpe_fdo_egl_exported_image*>(imagePointer));
619 struct ImageContext {
624 void WPEView::handleExportedImage(gpointer image)
626 ImageContext* imageContext = g_slice_new(ImageContext);
627 imageContext->view = this;
628 imageContext->image = static_cast<gpointer>(image);
629 EGLImageKHR eglImage;
630 #if USE_DEPRECATED_FDO_EGL_IMAGE
631 eglImage = static_cast<EGLImageKHR>(image);
633 eglImage = wpe_fdo_egl_exported_image_get_egl_image(static_cast<struct wpe_fdo_egl_exported_image*>(image));
636 auto* gstImage = gst_egl_image_new_wrapped(gst.context, eglImage, GST_GL_RGBA, imageContext, s_releaseImage);
638 GMutexHolder lock(images_mutex);
640 GST_TRACE("EGLImage %p wrapped in GstEGLImage %" GST_PTR_FORMAT, eglImage, gstImage);
641 gst_clear_mini_object ((GstMiniObject **) &egl.pending);
642 egl.pending = gstImage;
644 notifyLoadFinished();
648 #if ENABLE_SHM_BUFFER_SUPPORT
649 struct SHMBufferContext {
651 struct wpe_fdo_shm_exported_buffer* buffer;
654 void WPEView::releaseSHMBuffer(gpointer data)
656 SHMBufferContext* context = static_cast<SHMBufferContext*>(data);
657 s_view->dispatch([&]() {
658 auto* buffer = static_cast<struct wpe_fdo_shm_exported_buffer*>(context->buffer);
659 GST_TRACE("Dispatch release exported buffer %p", buffer);
660 wpe_view_backend_exportable_fdo_dispatch_release_shm_exported_buffer(wpe.exportable, buffer);
664 void WPEView::s_releaseSHMBuffer(gpointer data)
666 SHMBufferContext* context = static_cast<SHMBufferContext*>(data);
667 context->view->releaseSHMBuffer(data);
668 g_slice_free(SHMBufferContext, context);
671 void WPEView::handleExportedBuffer(struct wpe_fdo_shm_exported_buffer* buffer)
673 struct wl_shm_buffer* shmBuffer = wpe_fdo_shm_exported_buffer_get_shm_buffer(buffer);
674 auto format = wl_shm_buffer_get_format(shmBuffer);
675 if (format != WL_SHM_FORMAT_ARGB8888 && format != WL_SHM_FORMAT_XRGB8888) {
676 GST_ERROR("Unsupported pixel format: %d", format);
680 int32_t width = wl_shm_buffer_get_width(shmBuffer);
681 int32_t height = wl_shm_buffer_get_height(shmBuffer);
682 gint stride = wl_shm_buffer_get_stride(shmBuffer);
683 gsize size = width * height * 4;
684 auto* data = static_cast<uint8_t*>(wl_shm_buffer_get_data(shmBuffer));
686 SHMBufferContext* bufferContext = g_slice_new(SHMBufferContext);
687 bufferContext->view = this;
688 bufferContext->buffer = buffer;
690 auto* gstBuffer = gst_buffer_new_wrapped_full(GST_MEMORY_FLAG_READONLY, data, size, 0, size, bufferContext, s_releaseSHMBuffer);
695 gst_buffer_add_video_meta_full(gstBuffer, GST_VIDEO_FRAME_FLAG_NONE, GST_VIDEO_FORMAT_BGRA, width, height, 1, offsets, strides);
698 GMutexHolder lock(images_mutex);
699 GST_TRACE("SHM buffer %p wrapped in buffer %" GST_PTR_FORMAT, buffer, gstBuffer);
700 gst_clear_buffer (&shm.pending);
701 shm.pending = gstBuffer;
702 notifyLoadFinished();
707 struct wpe_view_backend_exportable_fdo_egl_client WPEView::s_exportableEGLClient = {
708 #if USE_DEPRECATED_FDO_EGL_IMAGE
710 [](void* data, EGLImageKHR image) {
711 auto& view = *static_cast<WPEView*>(data);
712 view.handleExportedImage(static_cast<gpointer>(image));
718 [](void* data, struct wpe_fdo_egl_exported_image* image) {
719 auto& view = *static_cast<WPEView*>(data);
720 view.handleExportedImage(static_cast<gpointer>(image));
723 #endif // USE_DEPRECATED_FDO_EGL_IMAGE
728 #if ENABLE_SHM_BUFFER_SUPPORT
729 struct wpe_view_backend_exportable_fdo_client WPEView::s_exportableClient = {
733 [](void* data, struct wpe_fdo_shm_exported_buffer* buffer) {
734 auto& view = *static_cast<WPEView*>(data);
735 view.handleExportedBuffer(buffer);
742 void WPEView::s_releaseImage(GstEGLImage* image, gpointer data)
744 ImageContext* context = static_cast<ImageContext*>(data);
745 context->view->releaseImage(context->image);
746 g_slice_free(ImageContext, context);
749 struct wpe_view_backend* WPEView::backend() const
751 return wpe.exportable ? wpe_view_backend_exportable_fdo_get_view_backend(wpe.exportable) : nullptr;
754 void WPEView::dispatchKeyboardEvent(struct wpe_input_keyboard_event& wpe_event)
756 s_view->dispatch([&]() {
757 wpe_view_backend_dispatch_keyboard_event(backend(), &wpe_event);
761 void WPEView::dispatchPointerEvent(struct wpe_input_pointer_event& wpe_event)
763 s_view->dispatch([&]() {
764 wpe_view_backend_dispatch_pointer_event(backend(), &wpe_event);
768 void WPEView::dispatchAxisEvent(struct wpe_input_axis_event& wpe_event)
770 s_view->dispatch([&]() {
771 wpe_view_backend_dispatch_axis_event(backend(), &wpe_event);