I have noticed that on occasion, I will be unable to screenshare anything on Discord. The screenshare page will load and be loading indefinetely whenever I have any process with a window "not responding" (i.e. not responding to message queue events). I have since noticed that this ONLY occurs when an application other than Discord reports itself as "Not responding".
Hardware and driver versions/ OS versions (As I'm unsure if this is a quirk with my hardware config or not, but I doubt it is as I've been able to reproduce this consistently on various hardware of my own and of friends running Windows 10/11):
- CPU: Ryzen 9 9950X3D
- GPU: Nvidia RTX 4090 24GB
- RAM: 96GB (2x48GB) DDR5 @ 6000MHz
- Nvidia Driver Version: DCH 566.03
- Windows Version: Windows 11 24H2 26100.4946
Tested with clients:
ptb 435129 (300aadc) Host 1.0.1156 x64 (67706) Build Override: N/A Windows 11 64-bit (10.0.26100)
canary 435526 (65c60eb) Host 1.0.701 x64 (68039) Build Override: N/A Windows 11 64-bit (10.0.26100)
Electron 35.3.0
Chromium 134.0.6998.205
I've been able to reproduce this by writing a simple C# winforms app which does while(true) for 60 seconds to intentionally hang the process.
Repro program (no binaries, should compile with .NET 4.8 SDK): https://github.com/hyblocker/discord-screenshare-not-responding
My hypothesis is that the manner in which the Discord client enumerates processes sends a message to each window's event queue without timeout. Enumeration should not use SendMessage();
but instead use one of the following:
SendMessageCallback
SendNotifyMessage
PostMessage
PostThreadMessage