pajuka_88
pajuka_88

Reputation: 1

Error QXcbConnection: Could not connect to display :0 when running a Qt application on Wayland

Problem: I have an application consisting of two components: a service and a client. The service is responsible for launching the client using QProcess::startDetached. The problem is reproduced when I start from Wayland and do Log out, then log in to a new session and after that the service starts, but the client only runs for a moment and displays the next log:

QXcbConnection: Could not connect to display :0

Only restarting the service helps🥲

Environment Details:

echo $DISPLAY
:0

Question: what can it be? Perhaps the service is launched by the client before Xwayland is configured? I remind you that this happens only on Wayland and after Log out.

I tried to add a delay to the QProcess::startDetached call to change the distribution versions of the distributions, but it's useless

Upvotes: 0

Views: 10

Answers (0)

Related Questions