[epiphany] ephy-shell: Only add portal helper for non-GNOME environments
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-shell: Only add portal helper for non-GNOME environments
- Date: Fri, 11 Sep 2020 23:25:04 +0000 (UTC)
commit 77bdeb4bd4edb6b2b34fddbd31c2f1e5afc61856
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Thu Sep 10 16:06:51 2020 +0200
ephy-shell: Only add portal helper for non-GNOME environments
Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1330
src/ephy-desktop-utils.c | 11 +++++++++++
src/ephy-desktop-utils.h | 1 +
src/ephy-shell.c | 7 +++++--
3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-desktop-utils.c b/src/ephy-desktop-utils.c
index 54f21a1dd..008ed4d6c 100644
--- a/src/ephy-desktop-utils.c
+++ b/src/ephy-desktop-utils.c
@@ -35,6 +35,17 @@ is_desktop_pantheon (void)
return strstr (xdg_current_desktop, "Pantheon") != NULL;
}
+gboolean
+is_desktop_gnome (void)
+{
+ const gchar *xdg_current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
+
+ if (!xdg_current_desktop)
+ return FALSE;
+
+ return strstr (xdg_current_desktop, "GNOME") != NULL;
+}
+
GtkIconSize
get_icon_size (void)
{
diff --git a/src/ephy-desktop-utils.h b/src/ephy-desktop-utils.h
index c6fb04cad..c162f3f5a 100644
--- a/src/ephy-desktop-utils.h
+++ b/src/ephy-desktop-utils.h
@@ -31,6 +31,7 @@ typedef enum {
} EphyFaviconType;
gboolean is_desktop_pantheon (void);
+gboolean is_desktop_gnome (void);
GtkIconSize get_icon_size (void);
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index d0c85d0bd..ada829f38 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -24,6 +24,7 @@
#include "ephy-shell.h"
#include "ephy-debug.h"
+#include "ephy-desktop-utils.h"
#include "ephy-embed-container.h"
#include "ephy-embed-utils.h"
#include "ephy-file-helpers.h"
@@ -611,8 +612,10 @@ ephy_shell_activate (GApplication *application)
EphyShell *shell = EPHY_SHELL (application);
EphyEmbedShell *embed_shell = EPHY_EMBED_SHELL (shell);
- g_signal_connect (ephy_shell_get_net_monitor (shell), "notify::connectivity", G_CALLBACK
(connectivity_changed), shell);
- portal_check (shell);
+ if (!is_desktop_gnome ()) {
+ g_signal_connect (ephy_shell_get_net_monitor (shell), "notify::connectivity", G_CALLBACK
(connectivity_changed), shell);
+ portal_check (shell);
+ }
if (ephy_embed_shell_get_mode (embed_shell) == EPHY_EMBED_SHELL_MODE_AUTOMATION) {
WebKitWebContext *web_context = ephy_embed_shell_get_web_context (embed_shell);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]