当远程窗口连接断开时,QGuiApplication 暂停事件循环
我正在启动 QGuiApplication (Qt 5.12) 并使用远程桌面连接到 Windows 10 PC。当远程桌面连接打开时,一切工作正常,但是当我断开连接并让应用程序在周末运行时,我可以在日志中看到它停止处理 Qt 事件(在我的情况下主要与网络相关)。日志显示的最后一件事是“激活更改”事件。
当我周末后再次连接时,Qt 事件循环再次启动(日志再次显示“激活更改事件”),当然有大量排队事件,并且应用程序处于无响应状态(我正在记录循环中 Qt 事件队列的数量(使用 qGlobalPostedEventsCount)。
这曾经正常工作但停止工作,我认为由于计算机上的 Windows 更新(可能与此相同的根本原因线程 ?)。
当 Windows 远程连接终止时,这是应用程序的预期行为吗?是否有已知的修复方法?
I am starting a QGuiApplication (Qt 5.12) and using a remote desktop connection to a Windows 10 PC. Everything works fine while the remote desktop connection is open, but when I disconnect and let the application run during the week-end, I can see in the logs that it stops processing Qt events (mostly network related in my case). The last thing the logs show is an "activation change" event.
When I connect again after the weekend, the Qt event loop starts again (the logs show again "Activation Change event") and of course there is a huge amount of queued events and the application gets in a non responding state (I am logging the number of Qt events queue in the loop using qGlobalPostedEventsCount).
This used to work correctly but stopped working, I think due to an update of Windows on the machine (maybe same root-cause than this thread ?).
Is this the expected behavior for applications when the windows remote connection is terminated? Is there a known fix for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有设法正确解决这个问题。作为解决方法,使用 Microsoft“远程桌面”应用程序而不是使用“远程桌面连接”应用程序可以避免此问题。
I have not managed to properly fix the issue. As a work-around, using Microsoft "Remote Desktop" application instead of using the "Remote Desktop Connection" application avoids the issue.