also looking at this
fix(mobile): preserve native editing, navigation, and durable media requests
#369
36 files
+864
-185
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -22,6 +22,8 @@ pub extern "c" fn gtk_init(argc: ?*c_int, argv: ?*anyopaque) void; | ||
| 22 | 22 | pub extern "c" fn gtk_application_new(application_id: [*:0]const u8, flags: c_int) ?*anyopaque; |
| 23 | 23 | pub extern "c" fn g_application_register(app: *anyopaque, cancellable: ?*anyopaque, err: ?*?*anyopaque) c_int; |
| 24 | 24 | pub extern "c" fn g_application_get_is_remote(app: *anyopaque) c_int; |
| 25 | pub extern "c" fn g_application_get_dbus_connection(app: *anyopaque) ?*anyopaque; | |
| 26 | pub extern "c" fn g_dbus_connection_flush_sync(connection: *anyopaque, cancellable: ?*anyopaque, err: ?*?*anyopaque) c_int; | |
| 25 | 27 | pub extern "c" fn g_application_open(app: *anyopaque, files: [*]*anyopaque, n_files: c_int, hint: [*:0]const u8) void; |
| 26 | 28 | pub extern "c" fn g_file_new_for_uri(uri: [*:0]const u8) ?*anyopaque; |
| 27 | 29 | pub extern "c" fn g_file_get_uri(file: *anyopaque) ?[*:0]u8; |
| @@ -832,6 +834,11 @@ pub fn forwardDeepLinkIfRunning(url: []const u8) !bool { | ||
| 832 | 834 | defer g_object_unref(file); |
| 833 | 835 | var files = [_]*anyopaque{file}; |
| 834 | 836 | g_application_open(remote, &files, 1, ""); |
| 837 | // GApplication queues remote Open calls on D-Bus. This forwarding process | |
| 838 | // does not run g_application_run(), whose shutdown normally flushes them. | |
| 839 | // Flush before unref/exit so a warm link cannot die in the sender's queue. | |
| 840 | const connection = g_application_get_dbus_connection(remote) orelse return error.ApplicationBusUnavailable; | |
| 841 | if (g_dbus_connection_flush_sync(connection, null, null) == 0) return error.DeepLinkDispatchFailed; | |
| 835 | 842 | return true; |
| 836 | 843 | } |
| 837 | 844 | |