From e29d056a16fe0233d610c7a57eb141c3fd1dbba8 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Mon, 6 Apr 2026 20:29:09 -0500 Subject: Create parent directory for NXM socket if it doesn't exist XDG_RUNTIME_DIR may point to a non-existent path on some configurations, causing QLocalServer::listen to fail with "Name error". Ensure the parent directory exists before attempting to create the socket. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/src/nxmhandler_linux.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/src/nxmhandler_linux.cpp b/src/src/nxmhandler_linux.cpp index 9441375..5d4f8ab 100644 --- a/src/src/nxmhandler_linux.cpp +++ b/src/src/nxmhandler_linux.cpp @@ -266,6 +266,13 @@ bool NxmHandlerLinux::startListener() const QString path = socketPath(); + // Ensure parent directory exists (XDG_RUNTIME_DIR may point to a + // non-existent path on some configurations). + const QDir parentDir = QFileInfo(path).dir(); + if (!parentDir.exists()) { + QDir().mkpath(parentDir.absolutePath()); + } + QLocalServer::removeServer(path); if (QFileInfo::exists(path)) { QFile::remove(path); -- cgit v1.3.1