{"record":{"id":"842b14678b654a1a","repo":"xpipe-io/xpipe","slug":"systemtray-icons-are-not-supported-by-the-current","errorCode":null,"errorMessage":"SystemTray icons are not supported by the current desktop environment.","messagePattern":"SystemTray icons are not supported by the current desktop environment\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"app/src/main/java/io/xpipe/app/core/AppTrayIcon.java","lineNumber":90,"sourceCode":"            if (OsType.ofLocal() != OsType.MACOS) {\n                tray.remove(trayIcon);\n                AppOperationMode.switchToAsync(AppOperationMode.GUI);\n            }\n        });\n    }\n\n    private static Image loadImageFromURL(URL iconImagePath) {\n        try {\n            return ImageIO.read(iconImagePath);\n        } catch (IOException e) {\n            ErrorEventFactory.fromThrowable(e).handle();\n            return AppImages.toAwtImage(AppImages.DEFAULT_IMAGE);\n        }\n    }\n\n    private void ensureSystemTraySupported() {\n        if (!SystemTray.isSupported()) {\n            throw new UnsupportedOperationException(\n                    \"SystemTray icons are not \" + \"supported by the current desktop environment.\");\n        }\n    }\n\n    public void show() {\n        EventQueue.invokeLater(() -> {\n            try {\n                tray.add(this.trayIcon);\n            } catch (Exception e) {\n                // This can sometimes fail on Linux\n                ErrorEventFactory.fromThrowable(\"Unable to add TrayIcon\", e)\n                        .expected()\n                        .handle();\n            }\n        });\n    }\n\n    public void hide() {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/core/AppTrayIcon.java#L72-L108","documentation":"Java's SystemTray API reports whether the current desktop environment supports tray icons. XPipe throws this UnsupportedOperationException from ensureSystemTraySupported when SystemTray.isSupported() is false, i.e. the environment offers no system tray (common on minimal Linux desktops, Wayland setups without tray protocols, or headless systems).","triggerScenarios":"Constructing AppTrayIcon (constructor calls ensureSystemTraySupported) on a desktop environment where java.awt.SystemTray.isSupported() returns false.","commonSituations":"Running on a Linux WM without a freedesktop StatusNotifier/system tray; headless server or CI with a DISPLAY but no tray; some Wayland compositors; remote desktop sessions.","solutions":["Disable the tray icon feature in XPipe settings so AppTrayIcon is never created","Run under a desktop environment that provides a system tray (or add a tray provider applet)","If embedding, guard creation with SystemTray.isSupported() before instantiating AppTrayIcon"],"exampleFix":"// before\nvar tray = new AppTrayIcon();\n// after\nif (SystemTray.isSupported()) {\n    var tray = new AppTrayIcon();\n} else {\n    // fall back to no tray behavior\n}","handlingStrategy":"fallback","validationCode":"if (!java.awt.SystemTray.isSupported()) {\n    // skip tray setup\n}","typeGuard":"boolean trayAvailable() { return java.awt.SystemTray.isSupported(); }","tryCatchPattern":"try { new AppTrayIcon().show(); } catch (UnsupportedOperationException e) { /* proceed without tray icon */ }","preventionTips":["Feature-toggle the tray icon in settings","Guard tray code with SystemTray.isSupported()","Test on minimal Linux/Wayland environments"],"tags":["desktop","tray","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}