On Thu Apr 13 14:19:21 2023 +0000, Loïc Rebmeister wrote:
I'm not completely sure why this if statement is needed. For me the only reason this if statement should be here would be for security or stability purposes. But after looking at the code I'm not sure what security improvement this if statement introduce... If it's for stability and the code should not be called outside the desktop window thread, adding some logging seems more like welcome here. And if it's neither for security or stability purposes I think it would be a better idea to put the if statement somewhere else, because putting a if statement for a specific window that deep into a core part of `winewayland.drv` feel more like a workaround.
I don't know, this feels brittle. If something relies on being in the desktop window thread, or process, it should not run before the window is fully created, and calling `NtUserGetDesktopWindow()` is the way to make sure that it is.
The desktop startup process is convoluted, and explorer may start multiple times until one of them becomes the desktop process. Maybe this process could be simplified but otherwise I think it's risky to try working around its limitation.