瀏覽代碼

chore: update supabase version and setup new deeplink for linux (#3272)

Lucas.Xu 1 年之前
父節點
當前提交
6634a0ecb3

+ 0 - 8
frontend/appflowy_flutter/lib/startup/tasks/supabase_task.dart

@@ -51,14 +51,6 @@ class InitSupabaseTask extends LaunchTask {
     if (Platform.isWindows) {
       // register deep link for Windows
       registerProtocolHandler(appflowyDeepLinkSchema);
-    } else if (Platform.isLinux) {
-      // register deep link for Linux
-      await SupabaseAuth.instance.registerDBusService(
-        // these values should be compatible with the values in the desktop file
-        // dbus-interface.xml
-        '/io/appflowy/AppFlowy/Object',
-        'io.appflowy.AppFlowy',
-      );
     }
   }
 }

+ 3 - 2
frontend/appflowy_flutter/linux/CMakeLists.txt

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
 project(runner LANGUAGES CXX)
 
 set(BINARY_NAME "AppFlowy")
-set(APPLICATION_ID "io.appflowy.appflowy")
+set(APPLICATION_ID "io.appflowy.AppFlowy")
 
 cmake_policy(SET CMP0063 NEW)
 
@@ -55,6 +55,7 @@ apply_standard_settings(${BINARY_NAME})
 target_link_libraries(${BINARY_NAME} PRIVATE flutter)
 target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
 add_dependencies(${BINARY_NAME} flutter_assemble)
+
 # Only the install-generated bundle's copy of the executable will launch
 # correctly, since the resources must in the right relative locations. To avoid
 # people trying to run the unbundled copy, put it in a subdirectory instead of
@@ -68,11 +69,11 @@ set_target_properties(${BINARY_NAME}
 # them to the application.
 include(flutter/generated_plugins.cmake)
 
-
 # === Installation ===
 # By default, "installing" just makes a relocatable bundle in the build
 # directory.
 set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
+
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
   set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
 endif()

+ 10 - 4
frontend/appflowy_flutter/linux/my_application.cc

@@ -19,6 +19,13 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
 static void my_application_activate(GApplication *application)
 {
   MyApplication *self = MY_APPLICATION(application);
+
+  GList* windows = gtk_application_get_windows(GTK_APPLICATION(application));
+  if (windows) {
+    gtk_window_present(GTK_WINDOW(windows->data));
+    return;
+  }
+
   GtkWindow *window =
       GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
 
@@ -87,7 +94,7 @@ static gboolean my_application_local_command_line(GApplication *application, gch
   g_application_activate(application);
   *exit_status = 0;
 
-  return TRUE;
+  return FALSE;
 }
 
 // Implements GObject::dispose.
@@ -107,10 +114,9 @@ static void my_application_class_init(MyApplicationClass *klass)
 
 static void my_application_init(MyApplication *self) {}
 
-MyApplication *my_application_new()
-{
+MyApplication* my_application_new() {
   return MY_APPLICATION(g_object_new(my_application_get_type(),
                                      "application-id", APPLICATION_ID,
-                                     "flags", G_APPLICATION_NON_UNIQUE,
+                                     "flags", G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
                                      nullptr));
 }

+ 17 - 9
frontend/appflowy_flutter/pubspec.lock

@@ -29,8 +29,8 @@ packages:
     dependency: "direct overridden"
     description:
       path: "."
-      ref: f897e1d
-      resolved-ref: f897e1d81a3d9fcea632588479bc2814d493f7b5
+      ref: c64ce17
+      resolved-ref: c64ce174586267dbab1185ef9acb19b7c49fc7bd
       url: "https://github.com/LucasXu0/app_links"
     source: git
     version: "3.4.3"
@@ -628,6 +628,14 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "2.3.1"
+  gtk:
+    dependency: transitive
+    description:
+      name: gtk
+      sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.1.0"
   highlight:
     dependency: "direct main"
     description:
@@ -1109,10 +1117,10 @@ packages:
     dependency: transitive
     description:
       name: realtime_client
-      sha256: ff743de9bb0f46fcfffcfe64ae93062702dcd0f83a2ce8adc40d5fb7f542af90
+      sha256: b4b7bb293417dafc73943ed639209b2dcb796db8495e56bba29a4e26fadef5cd
       url: "https://pub.dev"
     source: hosted
-    version: "1.1.3"
+    version: "1.2.1"
   reorderables:
     dependency: "direct main"
     description:
@@ -1434,19 +1442,19 @@ packages:
     dependency: transitive
     description:
       name: supabase
-      sha256: "291e065aa8c9be06a0348743c184beafd038e109960bc3da201affd3eda811fc"
+      sha256: c48671b62720f15067f6b31abe964950bf1405b7eec367a97f683dee25715a77
       url: "https://pub.dev"
     source: hosted
-    version: "1.10.0"
+    version: "1.11.1"
   supabase_flutter:
     dependency: "direct main"
     description:
       path: "packages/supabase_flutter"
-      ref: e882842
-      resolved-ref: e8828421720896c0e1600de18f0db54f9f96a3b3
+      ref: "852119e"
+      resolved-ref: "852119e110224cce83b332e8681bc6f216a56c05"
       url: "https://github.com/LucasXu0/supabase-flutter"
     source: git
-    version: "1.10.12"
+    version: "1.10.14"
   super_clipboard:
     dependency: "direct main"
     description:

+ 2 - 2
frontend/appflowy_flutter/pubspec.yaml

@@ -131,12 +131,12 @@ dependency_overrides:
   supabase_flutter:
     git:
       url: https://github.com/LucasXu0/supabase-flutter
-      ref: e882842
+      ref: 852119e
       path: packages/supabase_flutter
   app_links:
     git:
       url: https://github.com/LucasXu0/app_links
-      ref: f897e1d
+      ref: c64ce17
   url_protocol:
     git:
       url: https://github.com/LucasXu0/flutter_url_protocol.git

+ 2 - 3
frontend/scripts/linux_distribution/deb/AppFlowy.desktop

@@ -5,6 +5,5 @@ Icon=/usr/share/icons/hicolor/scalable/apps/appflowy.svg
 Exec=env GDK_GL=gles /usr/bin/AppFlowy %U
 Categories=Network;Productivity;
 Keywords=Notes
-DBusActivatable=true
-Implements=io.appflowy.AppFlowy;
-Terminal=false
+Terminal=false
+MimeType=x-scheme-handler/appflowy-flutter;

+ 0 - 8
frontend/scripts/linux_distribution/deb/build_deb.sh

@@ -8,7 +8,6 @@ PACKAGE_NAME=$3
 PACKAGE=$LINUX_RELEASE_PRODUCTION/package
 LIB=$PACKAGE/usr/lib
 APPLICATIONS=$PACKAGE/usr/share/applications
-DBUS_SERVICES=$PACKAGE/usr/share/dbus-1/services
 ICONS=$PACKAGE/usr/share/icons/hicolor/scalable/apps
 METAINFO=$PACKAGE/usr/share/metainfo
 DEBIAN=$PACKAGE/DEBIAN
@@ -16,7 +15,6 @@ DEBIAN=$PACKAGE/DEBIAN
 # Create package folder
 mkdir -p $LIB
 mkdir -p $APPLICATIONS
-mkdir -p $DBUS_SERVICES
 mkdir -p $ICONS
 mkdir -p $METAINFO
 mkdir -p $DEBIAN
@@ -28,14 +26,8 @@ chmod 0755 $DEBIAN/postrm
 grep -rl "\[CHANGE_THIS\]" $DEBIAN/control | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"
 
 cp -fR $LINUX_RELEASE_PRODUCTION/AppFlowy $LIB
-cp ./scripts/linux_distribution/packaging/launcher.sh $LIB/AppFlowy
-chmod +x $LIB/AppFlowy/launcher.sh
-
 cp ./scripts/linux_distribution/deb/AppFlowy.desktop $APPLICATIONS
-cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.launcher.desktop $APPLICATIONS
-
 cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.metainfo.xml $METAINFO
-cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.service $DBUS_SERVICES
 cp ./scripts/linux_distribution/packaging/appflowy.svg $ICONS
 
 # Build the package