[gnome-software/1801-flatpak-is-launched-while-displaying-a-native-app] rpm-ostree: Pick RPM .desktop file when launching an app



commit 6d6845090f70d20083dda04ca4d8c4ac2fc80a88
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 23 10:42:10 2022 +0200

    rpm-ostree: Pick RPM .desktop file when launching an app
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1801

 plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index 5ef4c329a..31904413d 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -2320,6 +2320,21 @@ gs_plugin_app_upgrade_download (GsPlugin *plugin,
        return TRUE;
 }
 
+
+static gboolean
+plugin_rpmostree_pick_rpm_desktop_file_cb (GsPlugin *plugin,
+                                          GsApp *app,
+                                          const gchar *filename,
+                                          GKeyFile *key_file)
+{
+       return strstr (filename, "/snapd/") == NULL &&
+              strstr (filename, "/snap/") == NULL &&
+              strstr (filename, "/flatpak/") == NULL &&
+              g_key_file_has_group (key_file, "Desktop Entry") &&
+              !g_key_file_has_key (key_file, "Desktop Entry", "X-Flatpak", NULL) &&
+              !g_key_file_has_key (key_file, "Desktop Entry", "X-SnapInstanceName", NULL);
+}
+
 gboolean
 gs_plugin_launch (GsPlugin *plugin,
                   GsApp *app,
@@ -2330,7 +2345,7 @@ gs_plugin_launch (GsPlugin *plugin,
        if (!gs_app_has_management_plugin (app, plugin))
                return TRUE;
 
-       return gs_plugin_app_launch (plugin, app, error);
+       return gs_plugin_app_launch_filtered (plugin, app, plugin_rpmostree_pick_rpm_desktop_file_cb, NULL, 
error);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]