try to add linux webview support

This commit is contained in:
haorendashu
2025-02-08 19:05:31 +08:00
parent 725234ce98
commit beb20091ee
20 changed files with 689 additions and 40 deletions

View File

@@ -6,6 +6,7 @@
#endif
#include "flutter/generated_plugin_registrant.h"
#include <webview_cef/webview_cef_plugin.h>
struct _MyApplication {
GtkApplication parent_instance;
@@ -54,6 +55,8 @@ static void my_application_activate(GApplication* application) {
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);
g_signal_connect(view, "key_press_event", G_CALLBACK(processKeyEventForCEF), nullptr);
g_signal_connect(view, "key_release_event", G_CALLBACK(processKeyEventForCEF), nullptr);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));