fix: make the application icon work everywhere #55

Merged
mysticalsoap merged 3 commits from mysticalsoap/fix/app-icons into trunk 2026-08-19 11:47:22 -04:00 AGit
Owner

Problem

The code half of #11 and all of #51. Three stacked misses:

  1. qt5-svg is only an optdepend of python-pyqt5, and without Qt's SVG icon engine fromTheme("aqomui") cannot load our scalable-only hicolor icon — null window icon, null tray icon (the journal's QSystemTrayIcon::setVisible: No Icon set).
  2. On Wayland the taskbar/alt-tab icon comes from matching the window's app_id to a desktop file; ours was the python binary's, matching nothing → the generic fallback-W. On X11 the WM_CLASS (aqomui-gui) never matched aqomui.desktop either.
  3. #51's "application closes when trying to minimize": a QSystemTrayIcon holding a null icon is invisible on most desktops, but isSystemTrayAvailable() still answers yes — so the quit dialog offered Minimize and hid the window into an invisible tray. The process kept running with no way back; it looked closed.

Fix

One commit each:

  • PKGBUILD: qt5-svg becomes a hard dependency (with a comment on why); main() calls setDesktopFileName("aqomui") for the Wayland app_id match; the desktop file gains StartupWMClass = aqomui-gui for X11.
  • GUI: systemtray() now treats an unloadable tray icon as "no tray" — window shown normally, and the quit dialog's Minimize option is gated on the tray actually being usable, so the window can never be hidden into nothing.
  • README: the description now expands the name — Another Qt OpenVPN Management UI — a leftover from the rename sweeps.

Verification

  • compileall clean; CI runs pytest/ruff
  • The qt5-svg diagnosis is evidence-based (the dev host lacks it, libQt5Svg.so.5 import fails, and only scalable SVGs are installed for the icon) but the end-to-end result — colored tray icon, correct alt-tab icon, Minimize behaving — needs the rebuilt package installed in a live session to confirm; worth doing as part of the 0.9.0 pass
  • The no-tray fallback path is the same one already taken when isSystemTrayAvailable() is false, just with a wider trigger

Closes #11
Closes #51

Assisted-by: claude-fable-5

## Problem The code half of [#11](https://git.mysticalsoap.com/mysticalsoap/aqomui/issues/11) and all of [#51](https://git.mysticalsoap.com/mysticalsoap/aqomui/issues/51). Three stacked misses: 1. `qt5-svg` is only an *optdepend* of `python-pyqt5`, and without Qt's SVG icon engine `fromTheme("aqomui")` cannot load our scalable-only hicolor icon — null window icon, null tray icon (the journal's `QSystemTrayIcon::setVisible: No Icon set`). 2. On Wayland the taskbar/alt-tab icon comes from matching the window's app_id to a desktop file; ours was the python binary's, matching nothing → the generic fallback-W. On X11 the WM_CLASS (`aqomui-gui`) never matched `aqomui.desktop` either. 3. #51's "application closes when trying to minimize": a `QSystemTrayIcon` holding a null icon is invisible on most desktops, but `isSystemTrayAvailable()` still answers yes — so the quit dialog offered Minimize and hid the window into an invisible tray. The process kept running with no way back; it *looked* closed. ## Fix One commit each: - **PKGBUILD**: `qt5-svg` becomes a hard dependency (with a comment on why); `main()` calls `setDesktopFileName("aqomui")` for the Wayland app_id match; the desktop file gains `StartupWMClass = aqomui-gui` for X11. - **GUI**: `systemtray()` now treats an unloadable tray icon as "no tray" — window shown normally, and the quit dialog's Minimize option is gated on the tray actually being usable, so the window can never be hidden into nothing. - **README**: the description now expands the name — *Another* Qt OpenVPN Management UI — a leftover from the rename sweeps. ## Verification - `compileall` clean; CI runs pytest/ruff - The qt5-svg diagnosis is evidence-based (the dev host lacks it, `libQt5Svg.so.5` import fails, and only scalable SVGs are installed for the icon) but the end-to-end result — colored tray icon, correct alt-tab icon, Minimize behaving — needs the rebuilt package installed in a live session to confirm; worth doing as part of the 0.9.0 pass - The no-tray fallback path is the same one already taken when `isSystemTrayAvailable()` is false, just with a wider trigger Closes #11 Closes #51 Assisted-by: claude-fable-5
Three misses stacked up to a blank tray and the generic fallback icon:
qt5-svg is only an optdepend of python-pyqt5 but fromTheme() cannot
load our scalable-only hicolor icon without it; the Wayland app_id was
the python binary, matching no desktop file; and on X11 the WM_CLASS
never matched either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A QSystemTrayIcon with a null icon is invisible on most desktops, but
isSystemTrayAvailable() still says yes -- so the quit dialog offered
Minimize and hid the window with nothing to bring it back. That is
issue #51's "application closes when trying to minimize".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
change: expand the a in the README description
Some checks failed
ci / test (pull_request) Successful in 48s
ci / test (push) Has been cancelled
dd0b499783
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.