Package: modem-manager-gui
Version: 0.0.20
Severity: minor
Tags: patch upstream

Dear Maintainer,

for some reason, my system using i3wm does not have XDG_CURRENT_DESKTOP
set. This leads to a critical assertion when starting modem-manager-gui.
While this is no problem because the program still starts, it is easy
enough to fix, so here is a patch for it. I did not send it to upstream,
because there doesn't seem to be an active upstream anymore.

All the best,

   Wolfram

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.18.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages modem-manager-gui depends on:
ii  libayatana-appindicator3-1      0.5.90-5
ii  libc6                           2.33-7
ii  libcairo2                       1.16.0-6
ii  libgdbm6                        1.23-1
ii  libgdk-pixbuf-2.0-0             2.42.8+dfsg-2
ii  libglib2.0-0                    2.70.3-1
ii  libgtk-3-0                      3.24.34-1
ii  libgtkspell3-3-0                3.0.10-1
ii  mobile-broadband-provider-info  20210805-1
ii  modemmanager                    1.18.10-1
ii  network-manager                 1.38.2-1
ii  policykit-1                     0.105-31.1+b1
ii  ppp                             2.4.9-1+1

Versions of packages modem-manager-gui recommends:
ii  modem-manager-gui-help  0.0.20-4
pn  yelp                    <none>

Versions of packages modem-manager-gui suggests:
pn  evolution-data-server              <none>
pn  libindicate5 | libmessaging-menu0  <none>
ii  libnotify4                         0.8.1-1
From: Wolfram Sang <w...@kernel.org>
Date: Tue, 2 Aug 2022 17:32:53 +0200
Subject: avoid assertion when XDG_CURRENT_DESKTOP is not set

---
 src/addressbooks.c | 2 +-
 src/main.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/addressbooks.c b/src/addressbooks.c
index ff9c423..fd28285 100644
--- a/src/addressbooks.c
+++ b/src/addressbooks.c
@@ -979,7 +979,7 @@ mmgui_addressbooks_t 
mmgui_addressbooks_new(mmgui_event_ext_callback callback, m
        addressbooks->gnomecontacts = NULL;
        
        /*GNOME code path*/
-       if (g_strrstr(desktop, "GNOME") != NULL) {
+       if (desktop && g_strrstr(desktop, "GNOME") != NULL) {
                if (mmgui_libpaths_cache_check_library_version(libcache, 
"libebook-1.2", 12, 3, 0)) {
                        /*Open module*/
                        addressbooks->ebookmodule = 
g_module_open(mmgui_libpaths_cache_get_library_full_path(libcache, 
"libebook-1.2"), G_MODULE_BIND_LAZY);
diff --git a/src/main.c b/src/main.c
index 733a190..2e31d13 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2035,7 +2035,7 @@ static void 
mmgui_main_tray_icon_build(mmgui_application_t mmguiapp)
        desktop = getenv("XDG_CURRENT_DESKTOP");
        
        /*Indicator*/
-       if (g_strrstr(desktop, "GNOME") != NULL) {
+       if (desktop && g_strrstr(desktop, "GNOME") != NULL) {
                iconfilepath = g_build_filename(RESOURCE_SYMBOLIC_ICONS_DIR, 
"modem-manager-gui-symbolic.svg", NULL);
        } else {
                iconfilepath = g_build_filename(RESOURCE_PNG_ICONS_DIR, 
"modem-manager-gui.png", NULL);

Reply via email to