Warning, /graphics/krita/packaging/linux/flatpak/patches/open-file-portal-writable.patch is written in an unsupported language. File is not indexed.

0001 From a958850fa3d283847618b0437be8bc4181bd90e9 Mon Sep 17 00:00:00 2001
0002 From: Jan Grulich <jgrulich@redhat.com>
0003 Date: Thu, 24 Sep 2020 07:17:02 +0200
0004 Subject: OpenFile portal: use "writable" option to specify our FD is writable
0005 
0006 When using OpenFile portal and passing a file descriptor, we open the
0007 file with qt_safe_open() which by defaults make the file descriptor
0008 writable. However we didn't specify in options that the FD is writable
0009 which leads into rejection on xdg-desktop-portal side as there is a
0010 mismatch between writable FD and read-only request.
0011 
0012 Pick-to: 5.15
0013 Change-Id: Ide02c0a1061243fbbe14264b3c31b8e5e292c165
0014 
0015 diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
0016 index cd32cd2a0b..e7b9ae3368 100644
0017 --- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
0018 +++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
0019 @@ -214,8 +214,10 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url)
0020          QDBusUnixFileDescriptor descriptor;
0021          descriptor.giveFileDescriptor(fd);
0022  
0023 -        // FIXME parent_window_id and handle writable option
0024 -        message << QString() << QVariant::fromValue(descriptor) << QVariantMap();
0025 +        const QVariantMap options = {{QLatin1String("writable"), true}};
0026 +
0027 +        // FIXME parent_window_id
0028 +        message << QString() << QVariant::fromValue(descriptor) << options;
0029  
0030          return QDBusConnection::sessionBus().call(message);
0031      }