<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Application Hangs when Main Window Closes]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have a very simple dimension converting application I developed with Desktop Qt 6.8.1:  Three text boxes and three labels; typing a number in one of the boxes displays that number converted to other units (e.g. inches to millimeters).<br />
<img src="https://ddgobkiprc33d.cloudfront.net/73fffaf9-40ad-49b1-b0bd-c2dbb2f0fd89.png" alt="09ef873e-e970-4571-b06f-a722ca011f72-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">On a Debian 12 system, when I close the window, the process doesn't exit.  Debugging shows that the <code>QApplication</code> destructor gets stuck waiting for a <code>QXcbEventQueue</code> to be destroyed, itself stuck in a call to <code>QThread::wait</code>.  This problem doesn't seem to occur on Windows.</p>
<p dir="auto">The <code>QXcbEventQueue</code> thread itself is stuck inside a call to <code>xcb_wait_for_event</code>.</p>
<p dir="auto">The <code>QDBusConnection</code> thread also seems to be stuck inside a call to <code>g_main_context_iteration</code>.</p>
<p dir="auto">My main.cpp:</p>
<pre><code>#include "mainwindow.h"
#include &lt;QApplication&gt;

int main(int argc, char * argv[]) {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}
</code></pre>
<p dir="auto">and my MainWindow constructor and destructor:</p>
<pre><code>MainWindow::MainWindow(QWidget * parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);
    connect(ui-&gt;txtIn, SIGNAL(textEdited(QString)), this, SLOT(txtInChanged(QString)));
    connect(ui-&gt;txtMils, SIGNAL(textEdited(QString)), this, SLOT(txtMilsChanged(QString)));
    connect(ui-&gt;txtMm, SIGNAL(textEdited(QString)), this, SLOT(txtMmChanged(QString)));
}

MainWindow::~MainWindow() 
{
    delete ui;
}
</code></pre>
<p dir="auto">The slots are simple methods that convert the text to a number, do the math, and put the result in the other two fields.</p>
<p dir="auto">This smells like a deadlock, but I don't know what might be causing it.</p>
<p dir="auto">I happen to be running this through an X2Go remote X session, which could be part of the problem; at application startup, the message <code>qt.qpa.xcb: X server does not support XInput 2</code> is emitted.  I haven't had a chance to check for this issue at the physical console (display :0).</p>
<p dir="auto">Are there any known issues with Qt 6.8 and remote X sessions?  What else might be causing this?</p>
]]></description><link>https://forum.qt.io/topic/164863/application-hangs-when-main-window-closes</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 20:31:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164863.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Jul 2026 16:24:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Application Hangs when Main Window Closes on Tue, 07 Jul 2026 22:50:40 GMT]]></title><description><![CDATA[<p dir="auto">Now, for the 20,000$ question...Are you using pure X11, or running the app under xwayland?</p>
]]></description><link>https://forum.qt.io/post/839044</link><guid isPermaLink="true">https://forum.qt.io/post/839044</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Tue, 07 Jul 2026 22:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to Application Hangs when Main Window Closes on Tue, 07 Jul 2026 19:24:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Beside the suggestion of <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a>, are you using the Qt version provided with your distribution ?</p>
]]></description><link>https://forum.qt.io/post/839041</link><guid isPermaLink="true">https://forum.qt.io/post/839041</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 07 Jul 2026 19:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to Application Hangs when Main Window Closes on Tue, 07 Jul 2026 17:43:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/brian_h">@<bdi>Brian_H</bdi></a><br />
I don't know anything about your contexts, but why do you need any widgets and connections at all?  Remove them and just test with <code>QWidget w;</code>, works right or same issue?  Then you know if it's just on exiting any Qt app.</p>
]]></description><link>https://forum.qt.io/post/839039</link><guid isPermaLink="true">https://forum.qt.io/post/839039</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 07 Jul 2026 17:43:07 GMT</pubDate></item></channel></rss>