applet: use appindicator if we can outside of X11
Fixes malfunction in sway spin.
This commit is contained in:
parent
3f782d3b7c
commit
42e5ac3c85
62
0002-appindicator-outside-X11.patch
Normal file
62
0002-appindicator-outside-X11.patch
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
From d0d7319228ea038860c055422960ef4ac490c01b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||||
|
Date: Thu, 16 Feb 2023 14:16:09 +0100
|
||||||
|
Subject: [PATCH] applet: use appindicator if we can outside of X11
|
||||||
|
|
||||||
|
The XEmbed-based GtkStatusIcon will silently do nothing in many
|
||||||
|
environments nowadays. In particular, it can't work outside X11.
|
||||||
|
|
||||||
|
Let's prefer X11 only if we got no app indicator support. Otherwise, use
|
||||||
|
the best backend possible and then turn on indicator support if it was
|
||||||
|
not X11.
|
||||||
|
|
||||||
|
Based on work by Aleksei Bavshin <alebastr89@gmail.com>.
|
||||||
|
|
||||||
|
https://gitlab.gnome.org/GNOME/network-manager-applet/-/merge_requests/129
|
||||||
|
---
|
||||||
|
src/applet.c | 9 +++++++++
|
||||||
|
src/main.c | 8 ++++++--
|
||||||
|
2 files changed, 15 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/applet.c b/src/applet.c
|
||||||
|
index 5c968ffe..8ef6833a 100644
|
||||||
|
--- a/src/applet.c
|
||||||
|
+++ b/src/applet.c
|
||||||
|
@@ -3392,6 +3392,15 @@ static void nma_init (NMApplet *applet)
|
||||||
|
{
|
||||||
|
applet->icon_size = 16;
|
||||||
|
|
||||||
|
+#ifdef WITH_APPINDICATOR
|
||||||
|
+#ifdef GDK_WINDOWING_X11
|
||||||
|
+ if (!GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
|
||||||
|
+ with_appindicator = TRUE;
|
||||||
|
+#else
|
||||||
|
+ with_appindicator = TRUE;
|
||||||
|
+#endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
g_signal_connect (applet, "startup", G_CALLBACK (applet_startup), NULL);
|
||||||
|
g_signal_connect (applet, "activate", G_CALLBACK (applet_activate), NULL);
|
||||||
|
}
|
||||||
|
diff --git a/src/main.c b/src/main.c
|
||||||
|
index 1c0f7e94..769ead4d 100644
|
||||||
|
--- a/src/main.c
|
||||||
|
+++ b/src/main.c
|
||||||
|
@@ -58,8 +58,12 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
|
bindtextdomain (GETTEXT_PACKAGE, NMALOCALEDIR);
|
||||||
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
|
- if (!with_appindicator)
|
||||||
|
- gdk_set_allowed_backends ("x11,*");
|
||||||
|
+#ifndef WITH_APPINDICATOR
|
||||||
|
+ /* If we got no app indicator, out only chance of doing anything
|
||||||
|
+ * useful is the XEmbed-based GtkStatusIcon, which only works on
|
||||||
|
+ * X11. Prefer it. */
|
||||||
|
+ gdk_set_allowed_backends ("x11,*");
|
||||||
|
+#endif
|
||||||
|
gtk_init (&argc, &argv);
|
||||||
|
textdomain (GETTEXT_PACKAGE);
|
||||||
|
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
@ -20,13 +20,14 @@
|
|||||||
Name: network-manager-applet
|
Name: network-manager-applet
|
||||||
Summary: A network control and status applet for NetworkManager
|
Summary: A network control and status applet for NetworkManager
|
||||||
Version: 1.30.0
|
Version: 1.30.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.gnome.org/projects/NetworkManager/
|
URL: http://www.gnome.org/projects/NetworkManager/
|
||||||
Obsoletes: NetworkManager-gnome < %{obsoletes_ver}
|
Obsoletes: NetworkManager-gnome < %{obsoletes_ver}
|
||||||
|
|
||||||
Source: https://download.gnome.org/sources/network-manager-applet/1.30/%{name}-%{version}.tar.xz
|
Source: https://download.gnome.org/sources/network-manager-applet/1.30/%{name}-%{version}.tar.xz
|
||||||
Patch1: 0001-nm-applet-no-notifications.patch
|
Patch1: 0001-nm-applet-no-notifications.patch
|
||||||
|
Patch2: https://gitlab.gnome.org/GNOME/network-manager-applet/-/commit/d0d73192.patch#/0002-appindicator-outside-X11.patch
|
||||||
|
|
||||||
Requires: NetworkManager >= %{nm_version}
|
Requires: NetworkManager >= %{nm_version}
|
||||||
Requires: libnotify >= 0.4.3
|
Requires: libnotify >= 0.4.3
|
||||||
@ -153,6 +154,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/nm-connection-edit
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Feb 17 2023 Lubomir Rintel <lkundrak@v3.sk> - 1.30.0-3
|
||||||
|
- applet: use appindicator if we can outside of X11
|
||||||
|
|
||||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.30.0-2
|
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.30.0-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user