Skip to content

Commit d305bbd

Browse files
ComixHereddevillg
authored andcommitted
feat(oci): enable xdg-desktop-portal for GTK/Qt apps by default
Sets GTK_USE_PORTAL=1 and QT_QPA_PLATFORMTHEME=xdgdesktopportal to ensure file dialogs use the host portal when running sandboxed. Signed-off-by: ComixHe <ComixHe1895@outlook.com>
1 parent ca6a44e commit d305bbd

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

libs/oci-cfg-generators/src/linglong/oci-cfg-generators/container_cfg_builder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,11 @@ utils::error::Result<void> ContainerCfgBuilder::buildEnv() noexcept
14501450
environment["LINGLONG_APPID"] = appId;
14511451
}
14521452

1453+
if (!disableGenerateContainerInfo) {
1454+
environment.try_emplace("GTK_USE_PORTAL", "1");
1455+
environment.try_emplace("QT_QPA_PLATFORMTHEME", "xdgdesktopportal");
1456+
}
1457+
14531458
auto envShFile = bundlePath / "00env.sh";
14541459
std::ofstream ofs(envShFile);
14551460
if (!ofs.is_open()) {

libs/oci-cfg-generators/src/linglong/oci-cfg-generators/container_cfg_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class ContainerCfgBuilder
325325

326326
bool isolateNetWorkEnabled = false;
327327
bool disableUserNamespaceEnabled = false;
328-
bool disableGenerateContainerInfo{ true };
328+
bool disableGenerateContainerInfo{ false };
329329
bool applyPatchEnabled = true;
330330
bool isolateTmp{ false };
331331
bool devPassthru{ false };

0 commit comments

Comments
 (0)