From 3747365f9af7c50a950d9ba61b14bd94d664344b Mon Sep 17 00:00:00 2001 From: jelveh Date: Thu, 14 Aug 2025 23:17:50 -0700 Subject: [PATCH 1/3] send source app data to opened app --- src/gui/src/helpers/launch_app.js | 14 ++++++++++++++ src/gui/src/services/ExecService.js | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/gui/src/helpers/launch_app.js b/src/gui/src/helpers/launch_app.js index 192bc6390..064794a47 100644 --- a/src/gui/src/helpers/launch_app.js +++ b/src/gui/src/helpers/launch_app.js @@ -207,6 +207,20 @@ const launch_app = async (options)=>{ iframe_url.searchParams.append('puter.parent_instance_id', options.parent_pseudo_id); } + // add source app metadata to URL + if (options.source_app_title) { + iframe_url.searchParams.append('puter.source_app.title', options.source_app_title); + } + if (options.source_app_id) { + iframe_url.searchParams.append('puter.source_app.id', options.source_app_id); + } + if (options.source_app_icon) { + iframe_url.searchParams.append('puter.source_app.icon', options.source_app_icon); + } + if (options.source_app_name) { + iframe_url.searchParams.append('puter.source_app.name', options.source_app_name); + } + if(file_signature){ iframe_url.searchParams.append('puter.item.uid', file_signature.uid); iframe_url.searchParams.append('puter.item.path', privacy_aware_path(options.file_path) || file_signature.path); diff --git a/src/gui/src/services/ExecService.js b/src/gui/src/services/ExecService.js index 8d26221fd..9e2ac5bb8 100644 --- a/src/gui/src/services/ExecService.js +++ b/src/gui/src/services/ExecService.js @@ -68,6 +68,29 @@ export class ExecService extends Service { Object.assign(params, provider()); } + // Collect source app metadata if available + let source_app_metadata = {}; + if (app) { + // Get the source app information + try { + const source_app_info = await window.get_apps(process?.name); + if (source_app_info && !Array.isArray(source_app_info)) { + source_app_metadata = { + source_app_title: source_app_info.title || process?.name, + source_app_id: source_app_info.uuid || source_app_info.uid, + source_app_icon: source_app_info.icon, + source_app_name: process?.name, + }; + } + } catch (error) { + // If we can't get app info, use basic process info + source_app_metadata = { + source_app_title: process?.name, + source_app_name: process?.name, + }; + } + } + // Handle file paths if provided and caller is in godmode let launch_options = { launched_by_exec_service: true, @@ -77,6 +100,7 @@ export class ExecService extends Service { parent_instance_id: app?.appInstanceID, uuid: child_instance_id, params, + ...source_app_metadata, ...(connection ? { parent_pseudo_id: connection.backward.uuid, } : {}), From bcfb9accb1b014cb22ec1cf2822ccd42e8c02ff9 Mon Sep 17 00:00:00 2001 From: jelveh Date: Thu, 14 Aug 2025 23:22:48 -0700 Subject: [PATCH 2/3] Update ExecService.js --- src/gui/src/services/ExecService.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/src/services/ExecService.js b/src/gui/src/services/ExecService.js index 9e2ac5bb8..0f18ddb42 100644 --- a/src/gui/src/services/ExecService.js +++ b/src/gui/src/services/ExecService.js @@ -86,6 +86,7 @@ export class ExecService extends Service { // If we can't get app info, use basic process info source_app_metadata = { source_app_title: process?.name, + source_app_id: process?.uuid, source_app_name: process?.name, }; } From 7277be75a8e326a4dec9de4aea70766edaafda45 Mon Sep 17 00:00:00 2001 From: jelveh Date: Thu, 14 Aug 2025 23:25:24 -0700 Subject: [PATCH 3/3] Update ExecService.js --- src/gui/src/services/ExecService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/src/services/ExecService.js b/src/gui/src/services/ExecService.js index 0f18ddb42..0cd4c4c33 100644 --- a/src/gui/src/services/ExecService.js +++ b/src/gui/src/services/ExecService.js @@ -79,7 +79,7 @@ export class ExecService extends Service { source_app_title: source_app_info.title || process?.name, source_app_id: source_app_info.uuid || source_app_info.uid, source_app_icon: source_app_info.icon, - source_app_name: process?.name, + source_app_name: source_app_info?.name || process?.name, }; } } catch (error) {