From 8a60b29674b670d50d6d44de3ae3bbd8e28fc26c Mon Sep 17 00:00:00 2001 From: crschnick Date: Sat, 13 Apr 2024 21:05:15 +0000 Subject: [PATCH] Improve platform notice --- .../main/java/io/xpipe/app/util/PlatformState.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/io/xpipe/app/util/PlatformState.java b/app/src/main/java/io/xpipe/app/util/PlatformState.java index 7c0bf40c..b6a21e84 100644 --- a/app/src/main/java/io/xpipe/app/util/PlatformState.java +++ b/app/src/main/java/io/xpipe/app/util/PlatformState.java @@ -73,6 +73,17 @@ public enum PlatformState { // Catch more than just the headless exception in case the graphics environment initialization completely // fails + } catch (HeadlessException h) { + var msg = OsType.getLocal().equals(OsType.LINUX) ? "No X11 DISPLAY variable was set or no headful library support was found." + + "\n\n" + + "Please note that XPipe is a desktop application that should be run on your local workstation." + + " It is able to provide the full functionality for all integrations via remote server connections, e.g. via SSH." + + " You don't have to install XPipe on any system like a server, a WSL distribution, a hypervisor, etc.," + + " to have full access to that system, a shell connection to it is enough for XPipe to work from your local machine." + : h.getMessage(); + TrackEvent.warn(h.getMessage()); + PlatformState.setCurrent(PlatformState.EXITED); + return Optional.of(new HeadlessException(msg)); } catch (Throwable t) { TrackEvent.warn(t.getMessage()); PlatformState.setCurrent(PlatformState.EXITED);