Backport MR #78 to help with apps launching slow on KDE (#2176759)

This commit is contained in:
Adam Williamson 2023-04-10 08:56:48 -07:00
parent de5ad5117e
commit d1dee958a0
2 changed files with 60 additions and 0 deletions

56
78.patch Normal file
View File

@ -0,0 +1,56 @@
From deb46a4d5ce170e33a9a999def5457375eef122f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Thu, 9 Mar 2023 18:22:30 +0100
Subject: [PATCH] systemd: Launch after gnome-session-initialized.target
This means we can rely on various entities being there on the D-Bus thus
won't need to manually wait for them.
---
data/xdg-desktop-portal-gnome.service.in | 1 +
src/externalwindow-wayland.c | 12 ------------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/data/xdg-desktop-portal-gnome.service.in b/data/xdg-desktop-portal-gnome.service.in
index 62ff2f9..8fc2e1a 100644
--- a/data/xdg-desktop-portal-gnome.service.in
+++ b/data/xdg-desktop-portal-gnome.service.in
@@ -1,5 +1,6 @@
[Unit]
Description=Portal service (GNOME implementation)
+After=gnome-session-initialized.target
[Service]
Type=dbus
diff --git a/src/externalwindow-wayland.c b/src/externalwindow-wayland.c
index b09d8a0..88be4c8 100644
--- a/src/externalwindow-wayland.c
+++ b/src/externalwindow-wayland.c
@@ -263,7 +263,6 @@ on_service_channel_name_appeared (GDBusConnection *connection,
GdkDisplay *
init_external_window_wayland_display (GError **error)
{
- guint watch_name_id;
gboolean name_appeared = FALSE;
g_autoptr(OrgGnomeMutterServiceChannel) proxy = NULL;
g_autoptr(GVariant) fd_variant = NULL;
@@ -272,17 +271,6 @@ init_external_window_wayland_display (GError **error)
g_autofree char *fd_str = NULL;
GdkDisplay *display;
- watch_name_id =
- g_bus_watch_name (G_BUS_TYPE_SESSION,
- "org.gnome.Mutter.ServiceChannel",
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- on_service_channel_name_appeared,
- NULL,
- &name_appeared, NULL);
- while (!name_appeared)
- g_main_context_iteration (NULL, TRUE);
- g_bus_unwatch_name (watch_name_id);
-
proxy = org_gnome_mutter_service_channel_proxy_new_for_bus_sync (
G_BUS_TYPE_SESSION,
(G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
--
GitLab

View File

@ -10,6 +10,10 @@ Summary: Backend implementation for xdg-desktop-portal using GNOME
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
URL: https://gitlab.gnome.org/GNOME/%{name} URL: https://gitlab.gnome.org/GNOME/%{name}
Source0: https://download.gnome.org/sources/%{name}/44/%{name}-%{tarball_version}.tar.xz Source0: https://download.gnome.org/sources/%{name}/44/%{name}-%{tarball_version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=2176759
# https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/78
# Help fix apps hanging on start in KDE with GNOME portal installed
Patch0: 78.patch
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
BuildRequires: gcc BuildRequires: gcc