Cherry-pick 3c7d5e7 to fix a critical on gtk_application_shutdown

When not using portals

Closes: #908070
This commit is contained in:
Iain Lane
2018-09-11 15:23:00 +01:00
parent 1ef8092e8a
commit 33c5b77edd
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,46 @@
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Wed, 5 Sep 2018 21:46:28 +0200
Subject: GtkApplication: Fix CRITICAL on shutdown when register_session=FALSE
Origin: upstream, commit:3c7d5e749ccafa75718ef00f1d5f6cdc0defacb3
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908070
---
gtk/gtkapplication-dbus.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/gtk/gtkapplication-dbus.c b/gtk/gtkapplication-dbus.c
index 25015eb..0946edf 100644
--- a/gtk/gtkapplication-dbus.c
+++ b/gtk/gtkapplication-dbus.c
@@ -826,15 +826,22 @@ gtk_application_impl_dbus_finalize (GObject *object)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) object;
- g_dbus_connection_call (dbus->session,
- "org.freedesktop.portal.Desktop",
- dbus->session_id,
- "org.freedesktop.portal.Session",
- "Close",
- NULL, NULL, 0, -1, NULL, NULL, NULL);
-
- g_free (dbus->session_id);
- g_dbus_connection_signal_unsubscribe (dbus->session, dbus->state_changed_handler);
+ if (dbus->session_id)
+ {
+ g_dbus_connection_call (dbus->session,
+ "org.freedesktop.portal.Desktop",
+ dbus->session_id,
+ "org.freedesktop.portal.Session",
+ "Close",
+ NULL, NULL, 0, -1, NULL, NULL, NULL);
+
+ g_free (dbus->session_id);
+ }
+
+ if (dbus->state_changed_handler)
+ g_dbus_connection_signal_unsubscribe (dbus->session,
+ dbus->state_changed_handler);
+
g_clear_object (&dbus->inhibit_proxy);
g_slist_free_full (dbus->inhibit_handles, inhibit_handle_free);
g_free (dbus->app_menu_path);

View File

@ -1,3 +1,4 @@
GtkApplication-Fix-CRITICAL-on-shutdown-when-register_ses.patch
016_no_offscreen_widgets_grabbing.patch
017_no_offscreen_device_grabbing.patch
018_gdkenumtypes.c_location.patch