Skip to content

Commit

Permalink
Workaround broken desktop files
Browse files Browse the repository at this point in the history
Recent Fedora broke firefox.desktop, by setting DBusActivatable=true,
while having invalid dbus name.
Fallback to a classic launch if loading dbus object fails.

Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2242454

Fixes QubesOS/qubes-issues#8571
Co-developed-with: Tobias Neitzel <tobias.neitzel@code-white.com>

(cherry picked from commit 3c2c33e)
  • Loading branch information
marmarek committed Oct 8, 2023
1 parent 8d17470 commit abb9ca8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qubesagent/xdg.py
Expand Up @@ -94,6 +94,7 @@ def launch(filename_or_entry, *files, **kwargs):
DBusGMainLoop(set_as_default=True)
if hasattr(launcher, 'get_boolean'):
activatable = launcher.get_boolean('DBusActivatable')
proxy = None
if activatable:
bus = dbus.SessionBus()
service_id = launcher.get_id()
Expand All @@ -104,6 +105,10 @@ def launch(filename_or_entry, *files, **kwargs):
replace('-', '_')
try:
proxy = bus.get_object(service_id, object_path)
except ValueError as e:
print(e, file=sys.stderr)
if proxy:
try:
match = bus.add_signal_receiver(
functools.partial(dbus_name_change, loop, service_id),
'NameOwnerChanged')
Expand Down

0 comments on commit abb9ca8

Please sign in to comment.