diff --git a/commet/lib/ui/pages/settings/categories/developer/developer_settings_page.dart b/commet/lib/ui/pages/settings/categories/developer/developer_settings_page.dart index 1e492edbb..734576497 100644 --- a/commet/lib/ui/pages/settings/categories/developer/developer_settings_page.dart +++ b/commet/lib/ui/pages/settings/categories/developer/developer_settings_page.dart @@ -6,6 +6,7 @@ import 'package:commet/config/build_config.dart'; import 'package:commet/config/platform_utils.dart'; import 'package:commet/diagnostic/diagnostics.dart'; import 'package:commet/main.dart'; +import 'package:commet/ui/navigation/adaptive_dialog.dart'; import 'package:commet/ui/navigation/navigation_utils.dart'; import 'package:commet/ui/pages/developer/benchmarks/timeline_viewer_benchmark.dart'; import 'package:commet/ui/pages/settings/categories/app/boolean_toggle.dart'; @@ -13,6 +14,7 @@ import 'package:commet/ui/pages/settings/categories/app/double_preference_slider import 'package:commet/ui/pages/settings/categories/developer/cumulative_diagnostics_widget.dart'; import 'package:commet/utils/background_tasks/background_task_manager.dart'; import 'package:commet/utils/background_tasks/mock_tasks.dart'; +import 'package:desktop_webview_window/desktop_webview_window.dart'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -38,6 +40,7 @@ class _DeveloperSettingsPageState extends State { windowSize(), notificationTests(), rendering(), + webView(), error(), if (PlatformUtils.isAndroid) shortcuts(), backgroundTasks(), @@ -305,6 +308,31 @@ class _DeveloperSettingsPageState extends State { ); } + Widget webView() { + return ExpansionTile( + title: const tiamat.Text.labelEmphasised("WebView"), + backgroundColor: Theme.of(context).colorScheme.surfaceContainerLow, + collapsedBackgroundColor: + Theme.of(context).colorScheme.surfaceContainerLow, + children: [ + Wrap(spacing: 8, runSpacing: 8, children: [ + tiamat.Button( + text: "Open Webview", + onTap: () async { + var url = await AdaptiveDialog.textPrompt(context); + if (url == null) return; + + var view = await WebviewWindow.create( + configuration: + CreateConfiguration(title: "Commet - Webview")); + view.launch(url); + view.openDevToolsWindow(); + }), + ]) + ], + ); + } + Widget error() { return ExpansionTile( title: const tiamat.Text.labelEmphasised("Error"), diff --git a/commet/linux/my_application.cc b/commet/linux/my_application.cc index 755c5bf37..3f852a266 100644 --- a/commet/linux/my_application.cc +++ b/commet/linux/my_application.cc @@ -89,7 +89,8 @@ MyApplication* my_application_new() { // the application to be recognized beyond its binary name. g_set_prgname(APPLICATION_ID); - + // https://github.com/commetchat/commet/issues/640 + setenv("__NV_DISABLE_EXPLICIT_SYNC", "1", 1); return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, diff --git a/commet/pubspec.yaml b/commet/pubspec.yaml index 79e079aa7..a3d0cbb50 100644 --- a/commet/pubspec.yaml +++ b/commet/pubspec.yaml @@ -100,7 +100,11 @@ dependencies: vodozemac: ^0.2.0 intl_translation: ^0.20.1 - + desktop_webview_window: + git: + url: https://github.com/commetchat/mixin-flutter-plugins.git + ref: webview-patch + path: ./packages/desktop_webview_window ## ---- Putting some extra lines in here to help git with the diff ## ---- Probably good to keep this stuff at the bottom of the list ## Begin Google Services Dependencies