summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Michael Brummer <jan.brummer@tabos.org>2020-09-10 16:06:51 +0200
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-09-11 23:22:25 +0000
commit77bdeb4bd4edb6b2b34fddbd31c2f1e5afc61856 (patch)
tree0124008af6ee83d302295fe7b666940ebf9fb618
parentc9873f2808a2d875f9f341d9c80f6878116783a0 (diff)
downloadepiphany-77bdeb4bd4edb6b2b34fddbd31c2f1e5afc61856.tar.gz
ephy-shell: Only add portal helper for non-GNOME environments
Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/1330
-rw-r--r--src/ephy-desktop-utils.c11
-rw-r--r--src/ephy-desktop-utils.h1
-rw-r--r--src/ephy-shell.c7
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);