Jinoh Kang (@iamahuman) commented about server/user.c:
> + * need atomic intrinsics to guarantee that. */
> +#if defined(__i386__) || defined(__x86_64__)
> + *ptr = value;
> +#else
> + __atomic_store_n(ptr, value, __ATOMIC_SEQ_CST);
> +#endif
> +}
> +
> +static void atomic_store_u64(volatile unsigned __int64 *ptr, unsigned __int64 value)
> +{
> + /* on x86 there should be total store order guarantees, so volatile is
> + * enough to ensure the stores aren't reordered by the compiler, and then
> + * they will always be seen in-order from other CPUs. On other archs, we
> + * need atomic intrinsics to guarantee that. */
> +#if defined(__i386__) || defined(__x86_64__)
> + *ptr = value;
64-bit volatile stores are not atomic on `__i386__`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610#note_98862
This workarounds KWin and Mutter window manager bugs/fanciness. The KWin bug is with maximized windows getting broken after sending a configure request, and which fix has been merged upstream already. The Mutter issue is unlikely to be fixed upstream, at least not its specific behavior, and we would instead better handle it as well as we can.
--
v5: winex11: Workaround KWin bug with maximized windows.
winex11: Set _NET_WM_USER_TIME to 0 to implement SWP_NOACTIVATE.
winex11: Keep track of the SWP flags to be used when mapping windows.
winex11: Keep _NET_WM_USER_TIME on the individual windows.
winex11: Workaround Mutter bug when changing decorations.
winex11: Update _MOTIF_WM_HINTS after _NET_WM_STATE and config.
winex11: Avoid creating windows with override-redirect flag set.
winex11: Track _MOTIF_WM_HINTS property in the state tracker.
winex11: Introduce a new handle_state_change helper.
winex11: Ignore transient state changes in other processes.
winex11: Give focus to the expected window when unampping with focus.
winex11: Use the current state when deciding how to reply to WM_TAKE_FOCUS.
winex11: Use the state tracker for the desktop window _NET_WM_STATE.
https://gitlab.winehq.org/wine/wine/-/merge_requests/6944
For https://gitlab.winehq.org/wine/wine/-/merge_requests/7512 to use it to locate window shared objects.
--
v10: win32u: Use the session shared object for user handle entries.
win32u: Use the session shared object to implement is_window.
server: Move the user object handle table to the shared memory.
server: Use NTUSER_OBJ constants for user object types.
server: Create a shared memory object for the global session.
include: Implement ReadAcquire64.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610
For https://gitlab.winehq.org/wine/wine/-/merge_requests/7512 to use it to locate window shared objects.
--
v9: win32u: Use the session shared object for user handle entries.
win32u: Use the session shared object to implement is_window.
server: Move the user object handle table to the shared memory.
server: Use NTUSER_OBJ constants for user object types.
server: Create a shared memory object for the global session.
include: Implement ReadAcquire64.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7610