[epiphany] downloads-manager: Don't assert on failure to acquire session inhibitor
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] downloads-manager: Don't assert on failure to acquire session inhibitor
- Date: Wed, 24 Feb 2016 23:23:01 +0000 (UTC)
commit aa22f74c39e0276ed5800620632e23b13ac97bb0
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Wed Feb 24 17:21:16 2016 -0600
downloads-manager: Don't assert on failure to acquire session inhibitor
This can happen if gnome-session is broken, or when running outside of
GNOME.
https://bugzilla.gnome.org/show_bug.cgi?id=762651
embed/ephy-downloads-manager.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-downloads-manager.c b/embed/ephy-downloads-manager.c
index 9fc714b..b7c1b2a 100644
--- a/embed/ephy-downloads-manager.c
+++ b/embed/ephy-downloads-manager.c
@@ -57,6 +57,9 @@ ephy_downloads_manager_acquire_session_inhibitor (EphyDownloadsManager *manager)
NULL,
GTK_APPLICATION_INHIBIT_LOGOUT |
GTK_APPLICATION_INHIBIT_SUSPEND,
"Downloading");
+
+ if (manager->inhibitor_cookie == 0)
+ g_warning ("Failed to acquire session inhibitor for active download. Is gnome-session running?");
}
static void
@@ -65,10 +68,11 @@ ephy_downloads_manager_release_session_inhibitor (EphyDownloadsManager *manager)
if (--manager->inhibitors > 0)
return;
- g_assert (manager->inhibitor_cookie > 0);
- gtk_application_uninhibit (GTK_APPLICATION (ephy_embed_shell_get_default ()),
- manager->inhibitor_cookie);
- manager->inhibitor_cookie = 0;
+ if (manager->inhibitor_cookie > 0) {
+ gtk_application_uninhibit (GTK_APPLICATION (ephy_embed_shell_get_default ()),
+ manager->inhibitor_cookie);
+ manager->inhibitor_cookie = 0;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]