On 2026-03-07 Andreas Metzler <[email protected]> wrote:
[...]
> Are you running wayland instead of X11? In that case you would also need
> to unset WAYLAND_DISPLAY.
Plus possibly XDG_SESSION_TYPE. The heuristics are a little bit strange
...
if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
// check a few environment variables that are usually set on X11 or Wayland
sessions
const bool hasWaylandDisplay = qEnvironmentVariableIsSet("WAYLAND_DISPLAY");
const bool isWaylandSessionType = qgetenv("XDG_SESSION_TYPE") == "wayland";
const bool hasX11Display = pinentry_have_display(argc, argv);
const bool isX11SessionType = qgetenv("XDG_SESSION_TYPE") == "x11";
const bool isGUISession = hasWaylandDisplay || isWaylandSessionType ||
hasX11Display || isX11SessionType;
qCDebug(PINENTRY_LOG) << "hasWaylandDisplay:" << hasWaylandDisplay;
qCDebug(PINENTRY_LOG) << "isWaylandSessionType:" << isWaylandSessionType;
qCDebug(PINENTRY_LOG) << "hasX11Display:" << hasX11Display;
qCDebug(PINENTRY_LOG) << "isX11SessionType:" << isX11SessionType;
qCDebug(PINENTRY_LOG) << "isGUISession:" << isGUISession;
#else
const bool isGUISession = pinentry_have_display(argc, argv);
#endif
if (!isGUISession) {
pinentry_cmd_handler = curses_cmd_handler;
pinentry_set_flavor_flag ("curses");
... I doubt it is possible to open an X11 window if DISPLAY is unset,
even if XDG_SESSION_TYPE=x11.
cu Andreas
--
"You people are noisy," Nia said.
I made the gesture of agreement.