Have ubuntu-desktop-minimal depend on xdg-desktop-portal-gnome

Bug #1970424 reported by Matthias Haschka
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-session (Ubuntu)
Fix Released
High
Unassigned
Jammy
Incomplete
High
Jeremy Bícha

Bug Description

Impact
------
Because ubuntu-desktop-minimal only recommends xdg-desktop-portal-gnome, it is easy for users to accidentally not have it installed. If it (Or another desktop portal backend are not installed), it breaks critical functionality for both the Firefox snap and Chromium snaps. It also breaks countless other snaps.

Test Case
---------
1. ubuntu-session and gnome-session should depend on xdg-desktop-portal-gnome

2. It should be possible to uninstall xdg-desktop-portal-gnome and keep xdg-desktop-portal-gtk. (This allows someone to keep using GTK3 and avoid the libadwaita dialogs which may be easier for third party themes.)

After installing or uninstall portal packages, you should log out and log back in to make sure the user services get stopped and started correctly.

What Could Go Wrong
-------------------
This just adds an additional dependency.

I believe the portal backends currently open by default in the locale sort order, so xdg-desktop-portal-gnome is preferred if installed, then xdg-desktop-portal-gtk, then xdg-desktop-portal-kde, then xdg-desktop-portal-wlr. Which coincidentally is the order we would want.

How This Was Fixed
------------------
ubuntu-desktop-minimal is a special germinate package and doesn't accept alternate dependencies. An alternate dependency is needed because we want to allow people to use a different portal backend and the easiest way to use a different portal backend is to install the backend you want and uninstall the ones you don't want.

Therefore, we are handling this with a dependency in ubuntu-session. We are also doing this with gnome-session since that's a popular alternative for people who want a vanilla GNOME experience.

Original Bug Report
-------------------
With ubuntu 22.04 firefox comes as snap package by default.

it is not possible to open any file dialog. save graphics as, save html page, import certificate never opens a file dialog.

firefox is completly useless without that file dialog.

(the root case is ubuntu uses snap)

further: in snap store firefox has no icon and it's called firefox not "Firefox".

Tags: snap
Revision history for this message
Jeremy Bícha (jbicha) wrote :

What desktop are you using?

If you are using either GNOME or the default Ubuntu desktop, make sure that xdg-desktop-portal-gnome is installed.

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Matthias Haschka (savosaren) wrote :

I am using GNOME Desktop. package xdg-desktop-portal-gnome is already installed:

LANG=C apt list | grep xdg-desktop

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libghc-xdg-desktop-entry-dev/jammy 0.1.1.1-1build3 amd64
libghc-xdg-desktop-entry-doc/jammy,jammy 0.1.1.1-1build3 all
libghc-xdg-desktop-entry-prof/jammy 0.1.1.1-1build3 amd64
xdg-desktop-portal-dev/jammy,jammy 1.14.3-0ubuntu2 all
xdg-desktop-portal-gnome/jammy 42.0.1-1ubuntu2 amd64
xdg-desktop-portal-gtk/jammy 1.14.0-1build1 amd64
xdg-desktop-portal-kde/jammy 5.24.4-0ubuntu1 amd64
xdg-desktop-portal-tests/jammy 1.14.3-0ubuntu2 amd64
xdg-desktop-portal-wlr/jammy 0.5.0-3 amd64
xdg-desktop-portal/jammy,now 1.14.3-0ubuntu2 amd64 [residual-config]

Revision history for this message
Matthias Haschka (savosaren) wrote :

When i select a save as menu entry in firefox, there as some messages in the error log (journalctl)

USER_AVC pid=655 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.123" pid=4424 label="snap.firefox.firefox" peer_pid=5279 peer_label="unconfined"
                                        exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Apr 26 15:44:04 upc15-bmws audit: MAC_TASK_CONTEXTS subj_apparmor=unconfined
Apr 26 15:44:04 upc15-bmws kernel: audit: type=1107 audit(1650980644.600:93): pid=655 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.123" pid=4424 label="snap.firefox.firefox" peer_pid=5279 peer_label="unconfined"
                                    exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Apr 26 15:44:04 upc15-bmws kernel: audit: type=1420 audit(1650980644.600:94): subj_apparmor=unconfined
Apr 26 15:44:04 upc15-bmws audit[655]: USER_AVC pid=655 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.123" pid=4424 label="snap.firefox.firefox" peer_pid=5279 peer_label="unconfined"
                                        exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Apr 26 15:44:04 upc15-bmws audit: MAC_TASK_CONTEXTS subj_apparmor=unconfined
Apr 26 15:44:04 upc15-bmws kernel: audit: type=1107 audit(1650980644.604:95): pid=655 uid=102 auid=4294967295 ses=4294967295 subj=? msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.123" pid=4424 label="snap.firefox.firefox" peer_pid=5279 peer_label="unconfined"
                                    exe="/usr/bin/dbus-daemon" sauid=102 hostname=? addr=? terminal=?'
Apr 26 15:44:04 upc15-bmws kernel: audit: type=1420 audit(1650980644.604:96): subj_apparmor=unconfined

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Are you sure it is installed? If it's installed, it should say it's installed like it does on my system:

xdg-desktop-portal-gnome/jammy,now 42.0.1-1ubuntu2 amd64 [installed,automatic]

Please run this command to fix your issue:

sudo apt install xdg-desktop-portal-gnome

Changed in firefox (Ubuntu):
status: Incomplete → New
tags: added: snap
Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Matthias Haschka (savosaren) wrote :

You are right. The package was not installed. Now it works.

I've installed Ubuntu 22.04 Desktop, minimal. Maybe the package xdg-desktop-portal-gnome is missing for that mode, but should be installed by default.

I apologize for the comment about snap.

This fixes also a problem with google chrome. Chrome freezes after closing a file dialog without that package installed.

I'm very happy with the quick help. Thank you very much.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

ubuntu-desktop-minimal Recommends xdg-desktop-portal-gnome and Recommends are installed by default.

If you intentionally don't install Recommends, then your system will have bugs like this.

But we can look at making the dependency stronger.

Changed in firefox (Ubuntu):
status: Incomplete → Invalid
affects: firefox (Ubuntu) → ubuntu-meta (Ubuntu)
Changed in ubuntu-meta (Ubuntu):
importance: Undecided → Medium
status: Invalid → Triaged
summary: - firefox snap can not open any file dialogs
+ Have ubuntu-desktop-minimal depend on xdg-desktop-portal-gnome
Jeremy Bícha (jbicha)
description: updated
Changed in ubuntu-meta (Ubuntu):
importance: Medium → High
Jeremy Bícha (jbicha)
Changed in ubuntu-meta (Ubuntu Jammy):
importance: Undecided → High
status: New → Triaged
assignee: nobody → Jeremy Bicha (jbicha)
Changed in ubuntu-meta (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-meta - 1.483

---------------
ubuntu-meta (1.483) kinetic; urgency=medium

  * Refreshed dependencies
  * Have desktop-minimal depend on instead of recommend
    xdg-desktop-portal-gnome (LP: #1970424)
  * Removed xdg-desktop-portal-gtk from desktop-minimal-recommends,
    desktop-recommends

 -- Jeremy Bicha <email address hidden> Sat, 30 Apr 2022 14:23:35 -0400

Changed in ubuntu-meta (Ubuntu):
status: Fix Committed → Fix Released
Jeremy Bícha (jbicha)
affects: ubuntu-meta (Ubuntu) → gnome-session (Ubuntu)
Changed in gnome-session (Ubuntu):
status: Fix Released → Triaged
description: updated
Jeremy Bícha (jbicha)
Changed in gnome-session (Ubuntu):
status: Triaged → Fix Committed
Jeremy Bícha (jbicha)
description: updated
Jeremy Bícha (jbicha)
Changed in gnome-session (Ubuntu Jammy):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-session - 42.0-1ubuntu3

---------------
gnome-session (42.0-1ubuntu3) kinetic; urgency=medium

  * debian/gnome-session-common.install: Don't install gnome-mimeapps.list
    (installed by desktop-file-utils in Ubuntu) (LP: #1970248)
  * Have gnome-session and ubuntu-session depend on
    xdg-desktop-portal-gnome | xdg-desktop-portal-backend (LP: #1970424)

 -- Jeremy Bicha <email address hidden> Sun, 01 May 2022 11:35:12 -0400

Changed in gnome-session (Ubuntu):
status: Fix Committed → Fix Released
Jeremy Bícha (jbicha)
description: updated
Revision history for this message
Robie Basak (racb) wrote :

> What Could Go Wrong

Adding a dependency can cause unintended side effects. For example, users may now (directly or indirectly) pull in a package that conflicts with something else they have installed. Have you looked for these? Does the alternative provided definitely cover all cases?

> I believe the portal backends currently open by default in the locale sort order, so xdg-desktop-portal-gnome is preferred if installed, then xdg-desktop-portal-gtk, then xdg-desktop-portal-kde, then xdg-desktop-portal-wlr. Which coincidentally is the order we would want.

Could this therefore cause user behaviour to change as a higher priority backend is dropped in? Again, has this been analysed?

It might all be fine, but these are the sorts of things that I think need documented analysis in the "What could go wrong" section.

Revision history for this message
Robie Basak (racb) wrote :

Marking as Incomplete for the benefit of SRU reviewers. Please set back once my questions are answered.

Changed in gnome-session (Ubuntu Jammy):
status: In Progress → Incomplete
Revision history for this message
Steve Langasek (vorlon) wrote :

I'd also like to ask if it would be reasonable to have ubuntu-desktop-minimal depend on xdg-desktop-portal-backend (while continuing to recommend xdg-desktop-portal-gnome), or if this would not work as expected.

Revision history for this message
Robie Basak (racb) wrote : Proposed package upload rejected

An upload of gnome-session to jammy-proposed has been rejected from the upload queue for the following reason: "Questions in https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1970424 oustanding for two months".

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

@Robie Basak (racb) please tell what we should to to see this fix in Ubuntu 22.04 LTS (Jammy) ?

> An upload of gnome-session to jammy-proposed has been rejected from the upload queue for the following reason: "Questions in https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1970424 oustanding for two months".

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.