On Tue May 23 14:15:36 2023 +0000, Alexandros Frantzis wrote:
TL;DR: Changed to `NtUserPostMessage` This was an intentional change, since this new approach makes the sync method straightforward and seems to me to be more "correct", as it removes any, even transient, disagreement between Wayland output and Wine monitor state in the desktop window process. From a practical perspective I think both sync and async processing of this message would work OK with the proper care. With async we need to ensure we properly handle any transient output/monitor state disagreement. With sync we need to avoid potential deadlocks between the dispatch thread and the (desktop) window thread. So, after all that, I think that I now have changed my mind again :) I'd rather deal with the potential of state disagreement (which is somewhat inherent anyway, and which I can manage internally) than deadlocks (however unlikely), so I have switched `NtUserPostMessage`. Thanks for raising this @rbernon!
BTW, this changes the effective "mask" of the operation from `QS_SENDMESSAGE` to `QS_POSTMESSAGE`, but I don't think this makes any practical difference in this case (esp. given that this is only relevant to the desktop window thread)? Is there some rule or rationale about which one to prefer for display change events, I see winex11 uses `QS_SENDMESSAGE` (the default case in `filter_event` for xrandr events, if I am not misunderstanding the logic), but winemac `QS_POSTMESSAGE`? If we want `QS_SENDMESSAGE` I could switch to `send_notify_message`.